Hi,
I have a Front End Form with a select field however i would like to get the option value of the select field as i would like to send an email to that option value. The value would be a supplier name although i would like to know if it has the pipes option like Contact form 7.
IE: Supplier A || [email protected]
I have found no info on the above so i need more options.
Question regarding this:
1) Before the post is published i would like to get the value of the select field. The issue i am having is that on selecting an option the select field does not add a “selected” value or id to distinguish it from the other options; this means that not even javascript can pull the value as it has nothing to hook on to.
<script>
$('#acf-field-YourSelectField').on('change', function() {
document.getElementById('TheIdOfTheDivYouWantToShowTheSelectedValue').value = $(this).val();
});
<script>
Then i set up my ACF select options in my group like so.
[email protected] : Supplier A
[email protected] : Supplier B
[email protected] : Supplier C
[email protected] : Supplier D
The Javascript will return the email address and not the Supplier A.
You can now use the new found value and echo it in a form recipient.
Hope this helps someone.