We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Freeform <select> fields ignoring required on form validation

Development and Programming

awsadmin's avatar
awsadmin
127 posts
17 years ago
awsadmin's avatar awsadmin

I am using the solspace freeform module, and am having issues getting the select field to be a required field. My input fields work fine, if I click submit without filling them out then the error will tell which field needs to be filled out. But on my select field, I have made it a required field, and if I hit submit without making a selection the form goes through without it recognizing it was a required field. Here is the code I used for the select field:

{exp:freeform:form form_name="" return="" notify="" template="" required="person_type"}

<select name=”person_type[]” > <option value=”null”>Choose your type</option> <option value=”student”>Student</option> <option value=”parent”>Parent</option> <option value=”counselor”>Counselor</option> <option value=”advisor”>Advisor</option> <option value=”mentor”>Mentor</option> <option value=”educator”>Educator</option> </select>

Freeform module control panel:

Field Name: person_type Field Type: Text input

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
17 years ago
Sue Crocker's avatar Sue Crocker

Change your first item to have:

<option value=”“>Choose your type</option>

And see if that works.

       
awsadmin's avatar
awsadmin
127 posts
17 years ago
awsadmin's avatar awsadmin

That worked along with taking out the “[]” for some reason. It didn’t show with the []. Thanks!

       
poThree's avatar
poThree
50 posts
16 years ago
poThree's avatar poThree

hey, I was having this same issue. My <select> fields were being ignored in the validation built into freeform. When you remove the “[]” the field doesn’t validate at all.

Does anyone know of a way to validate <select> fields with the freeform module. I’m guessing it isn’t possible within freeform which means I have to look into some other form of validation. Any suggestions?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.