Hi,
    To my understanding,  in the context of html Taglib, the Name attribute 
for the form elements such as <html:text> takes a different meaning than 
its original meaning in the standard html form elements. In this case, it refers
to the name of a javabean whose property will be used.
     Also, there's a very important characteristic of the property attribute for 
<html:text> that is it will be used for the name attribute in the underling html
element.  So by specifying the property attribute in the html taglib, you already
specify the name attribute for the html element.
    To solve your problem, you have to make appropriate changes to ensure that
the value (name) used for the property attribute has to be the same with your 
JavaScript used element name.

Hope this helps,
Shengmeng Liu
 
----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 9:02 PM
Subject: Re: Simple HTML form tag issue related to NAME attribute


> 
> Freek,
> 
> Thanks for responding.  The problem is that I am trying to use the NAME
> attribute in my Javascript code and if I put the NAME attribute in the
> html:text tag, it means something special to Struts.  I want Struts to
> ignore the NAME attribute.
> 
> Example:
> <html:text property="myProperty" name="myTextField"/>
> 
> I want Struts to ignore the name so that I can refer to the text field by
> name in Javascript.
> 
> Example.
> <javascript>
> validate(myTextField.value);
> </javascript>
> 
> Thanks,
> Dennis
> 
> 




Reply via email to