You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Frances Aleah Z. de Guzman" <ad...@ingenium.com.ph> on 2003/06/23 11:19:36 UTC

accessing form element in javascript

how can i access the values of my form elements using javascript in struts? 
example....
<html:form action="/timelog" onsubmit="return submitForm()">
	<html:text property="name"/>
	<html:text property="age"/>
	<html:submit property="action">Log</html:submit>
</html:form>

how can i access the value of the textbox "age"? before im putting like this 
in my javascript...."document.frmName.age.value"....but there is ni form name 
in the html:form, right?
-- 
Frances Aleah Z. De Guzman
SA/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph

Disclaimer :
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: accessing form element in javascript

Posted by "Frances Aleah Z. de Guzman" <ad...@ingenium.com.ph>.
thanks, it worked


On Monday 23 June 2003 05:33 pm, Firat TIRYAKI wrote:
> use the below statement. javascript has an array object of forms
> 
> document.forms[0].age.value;
> 
> F.
> 
> 
> ----- Original Message -----
> From: "Gemes Tibor" <ti...@i-trade.hu>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Monday, June 23, 2003 12:25 PM
> Subject: Re: accessing form element in javascript
> 
> 
>
> > Frances Aleah Z. de Guzman írta:
> >
> >
> > >how can i access the values of my form elements using javascript in
>
> struts?
>
> > >example....
> > ><html:form action="/timelog" onsubmit="return submitForm()">
> > > <html:text property="name"/>
> > > <html:text property="age"/>
> > > <html:submit property="action">Log</html:submit>
> > ></html:form>
> > >
> > >how can i access the value of the textbox "age"? before im putting like
>
> this
>
> > >in my javascript...."document.frmName.age.value"....but there is ni
> > > form
>
> name
>
> > >in the html:form, right?
> > >
> > >
> >
> > Check the generated html. (you'll find that the form name corresponds to
> > the name attribute)
> >
> > Tib
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

-- 
Frances Aleah Z. De Guzman
SA/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph

Disclaimer :
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: accessing form element in javascript

Posted by Firat TIRYAKI <fi...@pleksus.com.tr>.
use the below statement. javascript has an array object of forms

document.forms[0].age.value;

F.


----- Original Message -----
From: "Gemes Tibor" <ti...@i-trade.hu>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, June 23, 2003 12:25 PM
Subject: Re: accessing form element in javascript


> Frances Aleah Z. de Guzman írta:
>
> >how can i access the values of my form elements using javascript in
struts?
> >example....
> ><html:form action="/timelog" onsubmit="return submitForm()">
> > <html:text property="name"/>
> > <html:text property="age"/>
> > <html:submit property="action">Log</html:submit>
> ></html:form>
> >
> >how can i access the value of the textbox "age"? before im putting like
this
> >in my javascript...."document.frmName.age.value"....but there is ni form
name
> >in the html:form, right?
> >
> >
> Check the generated html. (you'll find that the form name corresponds to
> the name attribute)
>
> Tib
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: accessing form element in javascript

Posted by Gemes Tibor <ti...@i-trade.hu>.
Frances Aleah Z. de Guzman írta:

>how can i access the values of my form elements using javascript in struts? 
>example....
><html:form action="/timelog" onsubmit="return submitForm()">
>	<html:text property="name"/>
>	<html:text property="age"/>
>	<html:submit property="action">Log</html:submit>
></html:form>
>
>how can i access the value of the textbox "age"? before im putting like this 
>in my javascript...."document.frmName.age.value"....but there is ni form name 
>in the html:form, right?
>  
>
Check the generated html. (you'll find that the form name corresponds to 
the name attribute)

Tib



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org