Posted by Adrienne Boswell on 07/24/06 05:42
Gazing into my crystal ball I observed "Alok" <alok.sahoo@gmail.com>
writing in news:1153702279.610134.53870@m79g2000cwm.googlegroups.com:
> Hi ,
> I want to know is there any way to add a custome attribute to the a
> HTML element .For example ,
> <INPUT type=text name="txtNAME1" id="txtNAME1" size=7 maxlength=7
> displayName="dspNAME1">
>
> In the above example the custom attribute "displayName" is not a
> standard HTML attribute.
> If I can define the same I can push the intended value and access
> the same attribute's value through javascript .
>
> Advance thanks for any help in this regard .
>
You cannot add custom attributes, but you can do what you are setting out
to do with a little javascript and server side script. There's an
example at <http://www.intraproducts.com/usenet/requiredform.asp>.
Notice the form is prefilled with values that help the user (server
side). When the user focuses on the element, the value disappears
(javascript).
This script also uses CSS to help advise the user that something is
missing or wrong. There are no tables involved, only CSS and clean
markup.
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
[Back to original message]
|