JavaScript won't submit my form!

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

JavaScript won't submit my form!

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your submit button's name is submit.. the button is being called instead of the submission method.
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

Oh, so I need to change the name of the button.. Got it! Thanks ;)
Post Reply