Depends on the form field...  you can do

document.forms[0].fieldname.value = "";

for inputs and textareas. For selects you may need to do

document.forms[0].fieldname.selectedIndex = 0; (I believe - this is off the 
top of my head)

to force the select box to choose the first item (JS starts counting with 
0) in the list.

At 05:11 PM 10/3/2002 -0500, you wrote:
>Anyone got a code snippet for clearing a form field value with javascript?
>
>Thanks.
>
>Simon Attley
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to