IE doesn't understand the value attribute in select, and now I think how to replace it ... here is a code snippet

function send_form() { var x = document.getElementById("SEIF_content"); var data = { "SEIF": {} }; data["cat1"] = document.getElementById("cat1").value; data["cat2"] = document.getElementById("cat2").value; for (var i = 0; i < x.childNodes.length; i++) { if (x.childNodes[i].nodeType == 1 && x.childNodes[i].type == "select-one" && * * x.childNodes[i].value * * ) { data["SEIF"][x.childNodes[i].name] = * * x.childNodes[i].value * * ; } } // ajax отправка данных } 

    2 answers 2

    I advise you to use not pure JS but jquery. There are already many problems with cross-browser compatibility and it is easier to write

     $("select#my_select").val(); 

    And generally the form is sent by ajax in one line.

     $.post("test.php", $("#testform").serialize()); 
    • I would like without jquery)))) - IFreet
    • Are you straining the extra 32kb code? - deamondz

    at the onclick event, i.e. we collect all the options in an array, onclick we initialize some variable, accordingly the value you “generate yourself” and then read from it, did not encounter a similar problem, but it should help ...