我将后端小部件引用的名称更改为“carousel\\u edit\\u url\\u for\\u newspro/backendwnisoform.php”,以便将问题归结为其本质。
下面的代码很有效,赞扬G-d。然后我应该能够在程序开发的主流中使用这种代码,让下拉菜单正常工作,G-d愿意:
?><br>
<select id="<?php echo esc_attr( $this->get_field_id( \'myselect\' ) ); ?>" onchange="myFunction126(this.id, this.value)">
<option value="Audi">Audi
<option value="BMW">BMW
<option value="Mercedes">Mercedes
<option value="Volvo">Volvo
</select>
<p id="<?php echo esc_attr( $this->get_field_id( \'mydemo\' ) ); ?>">Hi There!</p>
<script type="text/javascript">
function myFunction126(thisid126, thisvalue126) {
var x126 = document.getElementById(thisid126).value;
var y126 = thisvalue126;
document.getElementById(id="<?php echo esc_attr( $this->get_field_id( \'mydemo\' ) ); ?>").innerHTML
= "You selected: " + x126;
alert ("New selection! x126 = " + x126 + " and y126 = " + thisvalue126);
}
</script>
对于那些希望最新脚本能够正常工作(仅针对这一孤立问题)的用户,可以从以下网站获得:
Zip file containing the plugin with the one element working just fine