webdork
asked on
javascript clear single text field
I want to clear a single form field (text) with a hyperlink.
Something like this:
<a href="javascript:form1.dat efield.val ue=' ' " >clear date</a>
Something like this:
<a href="javascript:form1.dat
ASKER
Its a syntax error. must be with the quote double quote
Ive tried
<a href='javascript:form1.USW P_Expiry.v alue=""' >clear date</a>
and
<a href="javascript:form1.USW P_Expiry.v alue= ' ' " >clear date</a>
Ive tried
<a href='javascript:form1.USW
and
<a href="javascript:form1.USW
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did it.
Thank you.
WD
Thank you.
WD
as long as:
The form has a "name" attribute of "form1", e.g.,
<form name="form1" ...>
and the input field has a "name" attribute of "datefield"
e.g.,
<input type="text" name="datefield">