开发者

Webform validation Drupal

I'm looking to add some speacial validation with webform through Drupal. It seems the old forms you could add extra PHP code to "Advanced Settings". According to this link we shouldn't be doing this anymore. (R开发者_如何学JAVAunning Drupal 6)

What I have is a check box that makes a few fields disappear and a few different fields appears. So for my validation I need to validate only the fields that are "present" depending on if the checkbox is checked or not. (Make them disappear/reappear with JQuery). The last step is to change the validation code.

I looked into the webform validation module, but it doesn't seem to hold what I need since I can't specify specific fields based on a checkbox.

How would I go about doing this?


With hook_form_alter you can add your own validation handler to the webform where you can validate the data as you like.


Have you considered using the http://drupal.org/project/webform_conditional module? (requires webform ver 3). It avoids the use of custom jquery and might work better better with webform validation module.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜