Why isn't this working????

Echo '
<form action="show.php" method="post" onChange="this.form.submit()">
<select>
<option value selected>select</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
</form> ';

if the form has any form field named 'submit' than just rename it to 'submit2' or anything else than 'submit'. run the code.

If it still doesn't works provide more detail about the code.

okay, i agree upon the previous reply.

change ur code with this........
it will work .......

echo '
<form action="show.php" method="post" onChange="this.submit()">
<select>
<option value selected>select</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<input type="submit" value="submit">
</form> ';

change ur code with this........
it will work .......

echo '
<form action="show.php" method="post" onChange="this.submit()">
<select>
<option value selected>select</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<input type="submit" value="submit">
</form> ';

Replace your Double Quotes by Single Quotes, and vice versa.

echo "<form action='show.php' method='post' onChange='this.submit()'><select><option value selected>select</option><option value='1'>1</option><option value='2'>2</option></select><input type='submit' value='submit'></form> ";

Regards...

Replace your Double Quotes by Single Quotes, and vice versa.

echo "<form action='show.php' method='post' onChange='this.submit()'><select><option value selected>select</option><option value='1'>1</option><option value='2'>2</option></select><input type='submit' value='submit'></form> ";

Regards...

why....that is not necessary.

Sorry .... onChange="this.submit();" goes in the SELECT tag

i was referring to replacing of the double quotes with single quotes. i was just wondering why you would do that. I really doesn't make much of a difference.

Thank you. My problem was the onchange was in the option not the select. Every other site neglects to mention that.

This article has been dead for over six months. Start a new discussion instead.