954,157 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

submit onchange not working

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> ';
BillyMako
Newbie Poster
16 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

the onchange="this.form.submit()" goes in the select tag.

kkeith29
Nearly a Posting Virtuoso
1,353 posts since Jun 2007
Reputation Points: 235
Solved Threads: 195
 

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.

nirbhab
Newbie Poster
2 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

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> ';
Manuz
Junior Poster
122 posts since Oct 2008
Reputation Points: 12
Solved Threads: 24
 

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 yourDouble 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...

sasankasekhar
Newbie Poster
24 posts since Jan 2007
Reputation Points: 10
Solved Threads: 3
 

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

echo "select12 ";

Regards...

why....that is not necessary.

kkeith29
Nearly a Posting Virtuoso
1,353 posts since Jun 2007
Reputation Points: 235
Solved Threads: 195
 
why....that is not necessary.

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

sasankasekhar
Newbie Poster
24 posts since Jan 2007
Reputation Points: 10
Solved Threads: 3
 
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.

kkeith29
Nearly a Posting Virtuoso
1,353 posts since Jun 2007
Reputation Points: 235
Solved Threads: 195
 

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

Yipyo
Newbie Poster
4 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You