WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Contact Form 7] Dynamic drop-down lists (3 posts)

  1. neevai
    Member
    Posted 4 years ago #

    Hi
    I am trying to improve the contact form on my site so that when you choose some car maker on a drop-down menu, then the car model drop-down menu will change according to the maker.
    for example:
    drop down 1: Nissan, Chevrolet, Honda
    drop down 2: please select maker
    --
    visitor clicked Nissan
    --
    drop down 2: 350z, gtr, maxima

    Now, using javascript I was able to do that, but contact form 7 wont send the value with the email. this is weired but I am pretty sure it is simple to solve. I am not familiar with the plug-in code so that is why Im asking you help :)

    here is my code:

    <script type="text/javascript">
    var maker = document.getElementById('maker');
    maker.setAttribute('onchange','changemodel(this.value)')
    
    function changemodel(maker) {
    var model = document.getElementById('model');
    model.options.length = 0;
    model.options[0]=new Option("3", "3", true, false);
    model.options[1]=new Option("6", "6", false, false);
    model.options[2]=new Option("MPV", "MPV", false, false);
    }
    </script>

    Thanks guys!

  2. donnaibasco
    Member
    Posted 3 years ago #

    did you find a solution to this?

  3. bmcc81
    Member
    Posted 3 years ago #

    I've also been looking everywhere for this answer.

    How to generate a drop down list from another drop down list.

    Has anyone done this with WP?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic