Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php jQuery Select无法更改输入值_Php_Jquery - Fatal编程技术网

Php jQuery Select无法更改输入值

Php jQuery Select无法更改输入值,php,jquery,Php,Jquery,我在PHP代码中有一个jquery: echo '<select id="state" name="state" onchange="document.getElementById(\'state_text_content\').value=this.options[this.selectedIndex].text> '.$list_state.' </select> <input type="hidden" name="state_text" id="st

我在PHP代码中有一个jquery:

echo '<select id="state" name="state" onchange="document.getElementById(\'state_text_content\').value=this.options[this.selectedIndex].text>
    '.$list_state.'
</select>
<input type="hidden" name="state_text" id="state_text_content" value="" />';
echo'
echo'
“.$list_state”
';

没有看到所有的东西,我想是因为你的拼写错误。onchange=“”

的末尾缺少一个引号,您忘了在
onchange
属性中终止字符串。@lolbas:抓得好,兄弟。。。现在可以了!谢谢
echo '<select id="state" name="state" onchange="document.getElementById(\'state_text_content\').value=this.options[this.selectedIndex].text">
    '.$list_state.'
</select>
<input type="hidden" name="state_text" id="state_text_content" value="" />';