Community

Setting fields to be mandatory or not based on a select box value on the same page

Hi There,

Can someone tell me how to do this properly? I have a few text box fields that are mandatory unless you select a specific value from the dropdown above it on the same page. I'm struggling to make this work. Any help would be greatly appreciated.

Thanks in advance.

Comments

If the text boxes are not

If the text boxes are not needed when the specific value is selected you could use the conditional fields module. Using it you can hide the text boxes for the select value(s). Submitting the form still works even if those text fields are marked required.

I thought that

but for some reason the select fields don't show up as options in the conditional fields that comes with drupal 7 for me.

Webform Conditional

Take a look at the Webform Conditional module -- this would seem to do what you want. You need the Webform module to use this; with the dev 7.x-4.0 version webform conditional has been integrated into the main Webform module.
If you aren't familiar with Webform, this may present a learning curve, but the module has so many useful features that the time learning about it will be well spent.

HTH.

Thanks. I am using the

Thanks. I am using the webform module. I just can't seem to get "select" types to show fields on the same page as options. The form I have built is multipage. I'm wondering if that is the cause of my problem.

nobody click here