PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Conditional Required

  1. vixvii
    Member

    My form is on http://www.topweddingphotos.com/team-registration-2/ (The URL is just temporary)

    Everything works great except that when I get to the number of students to register. I have to be sure the information is filled in correctly, so I have made required fields for the Student information. These fields are hidden and will only show when the Team Leader selects to register 5 or whatever number of students.

    The problem is that the rest of the fields that are still hidden are still required fields... Is it possible to only make them required when they are visible?

    Posted 13 years ago on Monday June 13, 2011 | Permalink
  2. Required Field's only trigger validation if they are displayed. If they are hidden by Conditional Logic the Required Field validation is ignored.

    Posted 13 years ago on Monday June 13, 2011 | Permalink
  3. vixvii
    Member

    Could you possibly see why I get the error on my form then when I get to the Student Registration? Everything works fine but when I get to the Student Information I keep getting the errors that the fields are required, even though I am filling them in. I can send you the admin login to the site if it will help, just tell me where to send it.

    Thanks

    Posted 13 years ago on Tuesday June 14, 2011 | Permalink
  4. vixvii
    Member

    I think I found the problem. I duplicated the Student fields from the XML and changed the field IDs. This seems to interfere with the way Gravity Forms handle IDs.

    Could you give me a quick explanation of how GF works with IDs when fields are created, moved or deleted?

    Must the IDs be numeric? I created ID's by using an alphabet character in front of each ID, for example id="a18" for Student 1 and id="b18" for Student 2

    If I duplicated fields in the XML and I have fields ranging from id 1 - 50, will GF automatically continue the sequence with id 51 when I add another field in the form editor?

    Posted 13 years ago on Tuesday June 14, 2011 | Permalink
  5. If you manipulated the XML and then re-imported the form, that is going to be the problem. The ID's must be numeric and unique and ideally in sequence. They can't be whatever you enter, they must be numeric and unique. That is going to be your problem. You can easily cause problems with a form by manipulating the XML improperly and then importing the form if you aren't 100% sure what you are doing with the XML.

    Posted 13 years ago on Tuesday June 14, 2011 | Permalink
  6. vixvii
    Member

    Thanks for the reply Carl and yip - it was definately the problem. They were unique but clearly id="a10" did not work that well.

    I manually renamed all the id's from 1 - 97 in the XML and imported the form. It works perfectly now. I just want to know - if I edit this form like normal in Wordpress, will Gravity Forms automatically add a new field as id 98?

    Posted 13 years ago on Tuesday June 14, 2011 | Permalink
  7. Yes, it should automatically add the field id's as normal. I believe base on the highest number that already exists.

    Posted 13 years ago on Tuesday June 14, 2011 | Permalink
  8. mail@ravnkilde.net
    Member

    Hi Gravity forms!

    "If they are hidden by Conditional Logic the Required Field validation is ignored." Do you consider to change/fix this. I sincerely miss this feature.

    Maybe you have a workaround for it?

    Br,
    Christian Ravnkilde

    PS: Great product!

    Posted 13 years ago on Thursday July 28, 2011 | Permalink
  9. vixvii
    Member

    Christian,
    "If they are hidden by Conditional Logic the Required Field validation is ignored." I don't believe this is a problem. If a field is hidden by conditional logic, the user cannot see it so they cannot enter a value. So the validation should be ignored on this field.

    In my case I have several users registering and I only show the details for the number of users registering at the time. It can be up to 10 users and the Name + Surname is required, but if only 6 register it means that the last 4 should stay hidden and the validation should not happen on those fields.

    I think GF is working perfectly :-)

    Posted 13 years ago on Friday July 29, 2011 | Permalink