WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Dynamically populated won't submit selected value (1 post)

  1. thv20
    Member
    Posted 3 years ago #

    I want to list all my WordPress multi-sites in a dropdown.
    At the moment, I achieve this by creating a JavaScript array and populating a blank <select class="subsites"> on window.ready.

    However, when I submit my form the values are not submitted.
    Hardcoded values are submitted.

    It seems the selected attribute is being ignored, not not even created!
    Any ideas?

    This is how I'm building my dropdown menu:

    var subsites=["One", "Two", "Three"];
    
    for (i=0;i<subsites.length;i++){
       var option = "<option value='"+subsites[i]+"'>"+subsites[i]+"</option>";
            $('.subsites').append(option);
    }

    http://wordpress.org/extend/plugins/contact-form-7/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic