How to Contact Form 7 Custom Select Option Value Sent to Email

If do you want to custom option value sent to email in contact form 7 wordpress plugin?
Please follow some steps for static select option values to send email address with contact form 7 wordpress plugin.

How to Contact form 7 custom select option value sent to email

Custom select option value sent to email with contact form 7 wordpress plugin

Do follow below some steps-

Step 1: First install Contact form 7 plugin on your wordpress website.
Step 2: Than create a new contact from.
Step 3: After than create a hidden filed as -
Step 4: [hidden formation id:formation_val]
Step 5: After keep static code on form as below code
Step 6: Add custom id with select field

<select id="formation">
<optgroup label="Business intelligence">
<option value="Consultant BI Microsoft">Consultant BI Microsoft</option>
<option value="Consultant BI Informatica">Consultant BI Informatica</option>
<option value="Consultant BI Talend">Consultant BI Talend</option>
<option value="Consultant BI Business Objects">Consultant BI Business Objects</option>
<option value="Consultant BI Azure">Consultant BI Azure</option>
<option value="Consultant fonctionnel BI/BIG DATA">Consultant fonctionnel BI/BIG DATA</option>
</optgroup>
</select>

Step 7: After than add below jquey code on your wordpress page.

Step 8: Cerate submit button and use id "submit_btn".

$(document).ready(function() {
$('#submit_btn').click(function() {
var formation=$('#formation :selected').val();
$('#formation_val').val(formation);
});
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

Add your emailid on contact from mail box and than check your email on inbox.

Post a Comment

Previous Post Next Post