我有一组由选择块中的javascript函数创建的选项。我创建了html字符串,然后将其分配给select块的innerHTML,但是(如调试所示)选项的值从带有转义和双引号的整数更改为字符串,更糟糕的是,当我尝试访问选择值时在POST中我得到null。 有没有人知道发生了什么? 感谢!!!
options = "<option value=64>2. TWO</option>\n"
options = options + "<option value=65>3. Three</option>\n"
document.getElementById('list').innerHTML = options;
&#13;
<?php
if ($_POST['action']=="GO"){
// I want to use the value here
echo $_POST['list']
}
?>
<form action = "<?php echo $_SERVER['REQUEST_URI'];?>" method = "POST" id="userform">
<select id = "list"></select><br>
<input type = "submit" name = "action" value = "GO" />
</form>
&#13;