Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter geonetben

    (@geonetben)

    I have added the below Javascript to modify the select options:

    <script type="text/javascript">
    $( document ).ready(function() {
         $("select[name=service]").html('<option value="[email protected]">Construction</option><option value="[email protected]">Bespoke Joinery</option><option value="[email protected]">Haulage</option><option value="[email protected]">Ground Works</option><option value="[email protected]">Materials Handeling</option><option value="[email protected]">Volumix Concrete</option><option value="[email protected]">Waste Management/Recycling</option><option value="[email protected]">Tyre & Body Shop</option><option value="[email protected]">Other</option><option value="[email protected]">Recruitment</option>');
    						
    $( "select[name=service]" ).change(function() {
        var text = $( "select[name=service] option:selected" ).text();
        $("input[name=service2]").val(text);
        $("input[name=service2]").text(text);
    });
    
    });
    </script>

    I have reverted it back so you can see what I am referring to above. If you need any more information, just let me know. Thanks again in advance.

    Kind regards,
    Ben

    Thread Starter geonetben

    (@geonetben)

    Thanks for your quick response.

    I have followed the instructions from that page, as you can see in the code provided above. I have discovered that the plugin is saving the variables. The issue is that it is not pulling the variables into the options generated on the frontend. See below:
    <select name="service" class="wpcf7-form-control wpcf7-select wpcf7-validates-as-required" aria-required="true" aria-invalid="false"><option value="Please Select Service...">Please Select Service...</option><option value="Construction">Construction</option><option value="Bespoke Joinery">Bespoke Joinery</option><option value="Haulage">Haulage</option><option value="Ground Works">Ground Works</option><option value="Materials Handeling">Materials Handeling</option><option value="Volumix Concrete">Volumix Concrete</option><option value="Waste Management/Recycling">Waste Management/Recycling</option><option value="Tyre & Body Shop">Tyre & Body Shop</option><option value="Other">Other</option><option value="Recruitment">Recruitment</option></select>

    As you can see the option labels are being inserted as the value also. Any suggestions?

    Kind regards,
    Ben

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