Page 1 of 1

JavaScript won't submit my form!

Posted: Sun Aug 07, 2005 1:36 pm
by pilau
Hi guys.
Can you tell me why's that JavaScript won't submite the form? It used to work...
Here, take a look:

Code: Select all

function expired(){
frm=document.forms[0];

frm.Button1[0].disabled=true;
frm.Button1[1].disabled=true;
frm.submit();
  //Put here the next page
}
And here's the HTML code I'm using:

Code: Select all

<HTML>
<HEAD>
<TITLE>Timer</TITLE>

<Script src="timer.js"></Script>
</HEAD>
<BODY onLoad="settimes()">

<FORM name="tom" action="test.php" method="POST">

<INPUT TYPE="radio" VALUE="Button 1" NAME="Button1" UNCHECKED>
<INPUT TYPE="radio"  VALUE="Button 2" NAME="Button1" UNCHECKED>
<input type="submit" name="submit">

</FORM>


</BODY>
</HTML>
Can you tell what's making the problem?
Thanks.

Posted: Sun Aug 07, 2005 2:47 pm
by feyd
your submit button's name is submit.. the button is being called instead of the submission method.

Posted: Sun Aug 07, 2005 3:27 pm
by pilau
Oh, so I need to change the name of the button.. Got it! Thanks ;)