Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

User Forms [v0.2.0]: Wont submit because required fields are hidden


Go to End


6 Posts   2099 Views

Avatar
Media Contour

Community Member, 33 Posts

27 August 2009 at 8:26am

I have User Forms [v0.2.0] installed and have created a contact form.

There is a dropdown with 2 options. The first option which is also by default selected displays a simple required textarea box to submit a message.

When the second option in the dropdown is selected it hides the required textarea and show multiple other required fields.

When either option is selected since some of the required fields are hidden and no value has been entered the form will not allow to submit.

How can I have it so that the hidden required fields aren't required anymore so that the form can submit.

Avatar
Willr

Forum Moderator, 5523 Posts

27 August 2009 at 3:46pm

Yea its a bit of a limitation with the module, only work around is to make fields which are conditional not required. I think a ticket on open.silverstripe.org to look into this but the whole validation / rules gets pretty complex really quickly!

Avatar
Media Contour

Community Member, 33 Posts

28 August 2009 at 5:15am

Thanks for the reply. It looks like the form will have no required fields anymore.

Here's another solution let me know if this can work. Can I populate all the fields with a value? So for example the hidden required fields have a default value or something so even though they're hidden and not field in they'll still populate and validate therefore submitting the form.

Avatar
Willr

Forum Moderator, 5523 Posts

28 August 2009 at 9:14am

Again, sadly you cannot specify a default value yet. Its on the todo list :)

Avatar
Media Contour

Community Member, 33 Posts

29 August 2009 at 4:01am

Thanks for your reply and love the User Form module.

Can't wait to see if in the future these specific form features can be added to the module.

Avatar
Juanitou

Community Member, 323 Posts

14 April 2010 at 8:48am

Hi!

I’ve opened a ticket for this to be, at least, traced. At first sight, I thought that adding an if hidden don’t validate condition somewhere in the validation code should be easy, but my knowledge of JavaScript is too limited by now.

I hope Will will find the time to code it!

Best regards,
Juan