Required Field validation for both shortcode inputs and HTML inputs
-
I am trying to validate two types of input fields together inside Contact Form 7.
I have the Contact Form 7 short-coded input fields as well as 3 simple HTML drop-down fields.
The reason I have 3 simple HTML drop-down fields inside Contact Form 7 is to use PHP to set up auto population of drop down values based on previous drop down selection for Vehicle Make, Vehicle Model and Vehicle Year. (I have this working…)
Can anyone point me in the right direction on how to achieve a validation message under each field to display the ‘This field is required.’ message? Contact Form 7 already has built in to display the validation message for the short-coded fields, I’m just stuck on applying the validation message to the simple HTML drop-down fields (if no selection is made) when the user clicks the Submit button.
Thank you.
[text* your-name placeholder "First Name*"] [email* your-email placeholder "Email*"] <select name="make" id="make-list" class="wpcf7-select-large" onChange="getModel(this.value);"></span> <option value="" disabled selected>Select Make*</option> <option value='1'>Alfa Romeo</option> <option value='2'>Ford</option> <option value='3'>Nissan</option> <option value='4'>Lexus</option> <option value='5'>Toyota</option></select> <select name="model-list" id="model-list" class="wpcf7-select-large" onChange="getYear(this.value);"> <option value="">Select Model*</option> </select> <select name="year-list" class="wpcf7-select-large" id="year-list" onChange="getBody(this.value);" required> <option value="">Select Year*</option> </select> [submit "Submit"]
- The topic ‘Required Field validation for both shortcode inputs and HTML inputs’ is closed to new replies.