Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.form.submit not working 1

Status
Not open for further replies.
Jan 26, 2001
550
GB
Hi All

I've got a form which I want to submit automatically when a checkbox is clicked, but for some bizarre reason it isn't working. (I have other forms on the same page which DO work with exactly the same code).

I i.e. I get the error message 'object doesn't support this method or property'.
In Firefox I get the error message 'document.wsform.submit is not a function'

here is the form I am using:

Code:
<form name="wsform" id="wsform" action="viewrequests.asp?action=updateworkshop" method="Post">

				  <input type="hidden" name="WORKSHOP_ID" value="10">
				  <input type="hidden" name="REQUEST_ID" value="817">
				  <tr>
				    <td width="53%">Assign iPos Number</td>
				    <td width="17%"><input name="WORKSHOP_IPOSNUMBER" type="text" id="WORKSHOP_IPOSNUMBER" value="fdsfdsf"></td>
				    <td width="17%"><input type="submit" name="wssubmit" value="Save"></td>
				    <td><input type="checkbox" name="WORKSHOP_IPOS" value="checkbox" checked></td>
			      </tr>

				  <tr>
				    <td colspan="3">Sent Performer Confirmation</td>
				    <td><input type="checkbox" name="WORKSHOP_SENTPERFORMERCONF" value="True"  onClick="document.wsform.submit();" ></td>
			      </tr>
				  <tr>
				    <td colspan="3">Sent Promoter Confirmation</td>
				    <td><input type="checkbox" name="WORKSHOP_SENTPROMOTERCONF" value="True"   onClick="document.wsform.submit();" ></td>
			      </tr>

				  <tr>
				    <td colspan="3">Printed Performer Report Form</td>
				    <td><input type="checkbox" name="WORKSHOP_PRINTEDPERFORMERREPORT" value="True"  onClick="document.wsform.submit();"  ></td>
			      </tr>
				  <tr>
				    <td colspan="3">Printed Promoter Report Form</td>
				    <td><input type="checkbox" name="WORKSHOP_PRINTEDPROMOTERREPORT" value="True"   onClick="document.wsform.submit();"  ></td>
			      </tr>

				  </form>
What the hell am I doing wrong?

Many thanks in advance
Nick

Nick (Webmaster)

 
The usual cause of this is having a form element named "sumbit", but you do not seem to have one of these.

Have you tried validating your HTML? I don't think yours will validate (although saying that, it depends on the DOCTYPE in use, which we aren't party to knowing), as you have a form element inside a table, but outside of the cells. You should move your form to outside of the table.

Try also changing all occurrences of "document.wsform.submit();" to simply "this.form.submit();" - it's far cleaner and more compatible.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
If that's your exact HTML, above, then the problem might be the missing TABLE tags or, if they exist outside of what you have shown, the inappropriate placement of FORM tags BETWEEN TABLE and TR tags.

I'm just stabbing in the dark here, but if that is the case, document.wsform... might not have worked because the parser works out-working-in when using document... calls. this.form... might have worked, however, because it works in-working-out to find the FORM this is a part of.

Heck, I'll go with that.

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top