Jump to:

11004 Posts in 2735 Topics by 1824 members

All other Modules

SilverStripe Forums » All other Modules » User Forms [v0.2.0]: Wont submit because required fields are hidden

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1428 Views
  • Media Contour
    Avatar
    Community Member
    33 Posts

    User Forms [v0.2.0]: Wont submit because required fields are hidden Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: User Forms [v0.2.0]: Wont submit because required fields are hidden Link to this post

    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!

  • Media Contour
    Avatar
    Community Member
    33 Posts

    Re: User Forms [v0.2.0]: Wont submit because required fields are hidden Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: User Forms [v0.2.0]: Wont submit because required fields are hidden Link to this post

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

  • Media Contour
    Avatar
    Community Member
    33 Posts

    Re: User Forms [v0.2.0]: Wont submit because required fields are hidden Link to this post

    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.

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: User Forms [v0.2.0]: Wont submit because required fields are hidden Link to this post

    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

    1428 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.