Clearing Text Box

Results 1 to 3 of 3

Thread: Clearing Text Box

  1. #1
    Candice Tran Guest

    Default Clearing Text Box

    I have an asp page where users enter search values into a text field. After they hit submit I display the search results with the search box on top. I populate the search text field with the previous search. I would like to have a reset button that clears the text field. But the normal html way doesn&#039;t clear it because it is pre-populated using asp.<BR><BR>How can I clear the field while maintaining all my search results?

  2. #2
    Join Date
    Dec 1969

    Default RE: Clearing Text Box

    Make sure the form is named:<BR>==== START<BR>&#060;form name="srchForm" action="..." method="..."&#062;<BR>&#060;input type="text" name="textboxname"&#062;<BR>&#060;/form&#062;<BR>==== END<BR><BR>Then just use the following JavaScript:<BR><BR>==== START<BR>&#060;script&#062;<BR>function chearContents(){<BR> document.srchForm.textboxname.value = "";<BR>}<BR>&#060;/script&#062;<BR>==== END<BR><BR>Call it when the reset button is hit, or whenever you need it.<BR><BR>Craig.

  3. #3
    Candice Tran Guest

    Default RE: Clearing Text Box

    Worked perfectly! Thanks so much!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts