<select name='cmg_select' onChange="javascript:window.location.href='index.php?'+this.value">
<option value='pening'> pening </option>
<option value='plete'> plete </option>
<option value='pening'> pening </option>
</select>
The concatenation is not working.
<select name='cmg_select' onChange="javascript:window.location.href='index.php?'+this.value">
<option value='pening'> pening </option>
<option value='plete'> plete </option>
<option value='pening'> pening </option>
</select>
The concatenation is not working.
Share Improve this question edited Mar 2, 2016 at 5:43 Caleb Eby 3864 silver badges14 bronze badges asked Jul 4, 2010 at 7:02 BharanikumarBharanikumar 25.7k50 gold badges135 silver badges201 bronze badges 2-
1
onChange
can and should be writtenonchange
. – Pekka Commented Jul 4, 2010 at 7:33 - And you shouldn't have two items with the same label and value. – Pekka Commented Jul 4, 2010 at 7:33
3 Answers
Reset to default 3- Remove the
javascript:
portion - Remove the
href
portion
The result :
< select name='cmg_select' onchange="window.location='index.php?'+this.value" >
Try this instead
<select name='cmg_select' onChange="window.location.href='index.php?'+this.options[this.selectedIndex].value">
<option value='pening' > pening </option>
<option value='plete' > plete </option>
<option value='pening' > pening </option>
</select>
Remove the javascript:
from the onchange
attribute.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744591666a4582642.html
评论列表(0条)