Contact form 7 : Customize dropdown options
When we are creating drop-down with the use of contact form 7, we are facing the issues with the validation. If we take an option then in that case required validation message will not show while submitting the form because the value not blank in this case.
Sometimes to resolve this we take a blank option which look like “–“. This sign will show on front-end and it look odd when we are making a good professional website.
To resolve this just code and paste below mentioned code in your theme’s function.php file :
function my_wpcf7_form_elements($html) { $text = '-Please Select-'; $html = str_replace('---', '' . $text . '', $html); return $html; } add_filter('wpcf7_form_elements', 'my_wpcf7_form_elements');
After using this code first option of the drop-down will become “Please Select” in place of “–“.
Note : Please look at the below mentioned points :
- This will work for all contact forms on the website with the use of contact form 7 plugin.
- Use Blank as a first option in drop-down of contact form.
sir how to add fields like objective question fields in contact like yes no answer please help me out sir
you should use a filed type “radio buttons” from the list of form fields..
You can do some thing like this in contactform7
[select* Test first_as_label “Placeholder” “Option 1” “Option 2”]
Find this link [http://wordpress.stackexchange.com/questions/213805/how-to-add-placeholder-for-contact-form7-for-dropdown]
Thank you,
hi
i want to show two dropdowns in contact form 7. one for category and an another for its items and when i select one category at the same time in an another dropdown only selected category’s items should be displayed… is it possible to do so ? if yes please tell me how is it possible
waiting for your response
Thanks & Regards
Jyotendra Singh
Hello Jyotendra,
Please let me know if you find solution to your problem, as I am also looking for it.
I Would really appreciate. Thank you in advance 🙂
You can do it with https://es.wordpress.org/plugins/cf7-conditional-fields/
Hi,
I want a dropdown menu with sub items like :
Option A
Option 1
Option 2
Option B
Option 1
Option 2
“dropdown search contact from 7” is best plugin to making your box field to automatically search option into section box.