1
<select name='cmg_select'  onChange="javascript:window.location.href='index.php?'+this.value">
    <option value='pening'> pening </option>
    <option value='complete'> complete </option>
    <option value='pening'> pening </option>
</select>

The concatenation is not working.

2
  • 1
    onChange can and should be written onchange . Commented Jul 4, 2010 at 7:33
  • And you shouldn't have two items with the same label and value. Commented Jul 4, 2010 at 7:33

3 Answers 3

3
  1. Remove the javascript: portion
  2. Remove the href portion

The result :

< select name='cmg_select' onchange="window.location='index.php?'+this.value" >

Sign up to request clarification or add additional context in comments.

Comments

2

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='complete' > complete </option>
<option value='pening' > pening </option>
</select>

Comments

1

Remove the javascript: from the onchange attribute.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.