Forum Moderators: open

Message Too Old, No Replies

Form Submit Not Working

         

ryanfromaustin

9:20 pm on Sep 26, 2005 (gmt 0)

10+ Year Member



I have some very simple code that submit a form when a select box is changed. The code is basically as follows:

<form name="frm" method="post" action="thispage.php">
<select name="mySelect" onChange="document.main.submit()">
<option>value 1</option>
<option>value 2</option>
</select>
</form>

This works just fine for me in every browser, however, I have heard several complaints from customers that when they change the select, they get a "Page not found" error. This apparently happens even in new versions of IE, but I cannot reproduce the error. Has anyone seen this? Does anyone have any thoughts or suggestions? I am running out of options here.

Eltiti

9:34 pm on Sep 26, 2005 (gmt 0)

10+ Year Member



I notice you've got:

form name="frm"

along with:

document.main.submit()

I think the second line should be:

document.frm.submit()

(That may or may not solve the problem, but it looked as if it wasn't correct...)

ryanfromaustin

9:55 pm on Sep 26, 2005 (gmt 0)

10+ Year Member



Sorry about that. I actully do call "document.frm.submit()".

Eltiti

1:05 am on Sep 27, 2005 (gmt 0)

10+ Year Member



OK, so that's not it, then...

No, other than that, the code looks "correct" to me. (There may be other/better ways to get similar results, depending on the details of what you want to achieve; but I didn't see anything that's actually "wrong"...) I hope others come up with better ideas!

dcrombie

3:26 pm on Sep 27, 2005 (gmt 0)



A better way:

onChange="this.form.submit();"

;)