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

  1. thv20
    Posted 5 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>";


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic