Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: Re: Using submit with JavaScript


Message #1 by "Martin Johansson" <mmttjj@h...> on Wed, 14 Mar 2001 12:23:01 +0100
Well, I usually have a form validation procedure that is associated with
each form on a page.  The code for the form processing is called in the form
tag such as:

<form name="blah" method="post" action="blee.htm"
onSubmit="processForm(this); return false;">

This should make certain that the correct form is processed.

As far as your error is concerned, do all your forms have different names
and closing tags?

Also, it might be helpful to see more of your code.  There may be another
totally different reason for the error.

Michael

----- Original Message -----
From: "Martin Johansson" <mmttjj@h...>
To: "javascript" <javascript@p...>
Sent: Wednesday, March 14, 2001 6:29 AM
Subject: [javascript] SV: Re: Using submit with JavaScript


Umm...now it says this.form is null or not an object. What shall i do?
--
Martin Johansson
CEO & Project Supervisor,
Sola Data
http://www.sd-gaming.com
http://www.sd-studios.com


-----Ursprungligt meddelande-----
Från: Michael A. Michalski [mailto:mmcihalski@n...]
Skickat: den 14 mars 2001 01:01
Till: javascript
Ämne: [javascript] Re: Using submit with JavaScript


Martin ---

Anytime you press a submit button, the form containing that form can be
obtained by calling this.form.  So when you press the button, you can write
the following as part of the submit tag

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

That will submit the form corresponding to the submit button pressed.

Michael

----- Original Message -----
From: "Martin Johansson" <mmttjj@h...>
To: "javascript" <javascript@p...>
Sent: Wednesday, March 14, 2001 2:16 AM
Subject: [javascript] Using submit with JavaScript


> On a page, I have not just one, lots of forms. If i use document.forms
> [0].submit() it will just submit the first form, right? I have some text
> written in a menu, and you can't make text post a form in any other way
> than using Java, so i really need help with this. Let's proceed. What i
> need is a way for text to sumbit a specified form, not just the first on
> the webpage. Got that? =) Well...hundreds of millions of thanks to the
> person who can help me out! =)


  Return to Index