If you are trying to refer to one of the forms in your document, there is an
array object holding all the forms in JavaScript. So you can call your form
by;

myForm=document.forms[0];

now myForm is the object that holds the reference to your first form in the
browser.

F.

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 20, 2003 10:58 AM
Subject: AW: JavaScript function inside JSP not working


> Hi,
>
> as far as i know, the <html:form>-tag doesn't support an attribute called
> 'name'.
> Maybe you'll take a look at
> http://jakarta.apache.org/struts/userGuide/struts-html.html#form
>
> (if there is a way to give the form element a name in order to refer to it
> by this name, i am very interested in the answer :o))
>
> Greetings
>
> Mario Gleichmann
>
> -----Ursprungliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 20. November 2003 04:57
> An: [EMAIL PROTECTED]
> Betreff: JavaScript function inside JSP not working
>
>
> I include the following javascript function in my .jsp
> file, but this function is not being called at all.  I
> won't even get any javascript error on build if I
> tried to change to some bogus function name, Can
> anybody please tell me why?
>
> What I want to do here is: disable the submit button
> until the required text field was filled.
>
> <SCRIPT LANGUAGE="JavaScript">
> function checkField() {
> return(!document.form1.textfield.value == "")
> }
> </SCRIPT>
>
>  <html:form
>       action="myAction"
>       name="form1"
>       onsubmit="checkField()">
>  <html:text property="textfield">
>  <html:submit property="submit" value="Submit">
>  </html:form>
>
>
>
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to