Support

Account

Home Forums General Issues A Few Questions

Solved

A Few Questions

  • 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 || supplierA@test.test

    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@test.test : Supplier A
    email2@test.test : Supplier B
    email3@test.test : Supplier C
    email4@test.test : 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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.