Refreshing Text Boxes

Results 1 to 3 of 3

Thread: Refreshing Text Boxes

  1. #1
    Join Date
    Dec 1969

    Default Refreshing Text Boxes

    Is there a way to refresh a text box whenever another option button is selected. What I have are three ways my user can search. Whenever they click a new way I would like for the text box of the previous search to be cleared.

  2. #2
    Join Date
    Dec 1969
    Indianapolis, IN

    Default RE: Refreshing Text Boxes

    Try setting up an onclick function that sets your textbox value to "".

  3. #3
    Join Date
    Dec 1969

    Default Only because I wrote..

    .. this yesterday.<BR><BR>Here:<BR>function clearForm(frm)<BR>{<BR> for(var x = 0; x &#060; frm.elements.length; x++)<BR> {<BR> // alert(frm.elements[x].name + ": " + frm.elements[x].type);<BR><BR> switch(frm.elements[x].type)<BR> {<BR> case "text":<BR> frm.elements[x].value = "";<BR> break;<BR> case "checkbox":<BR> // handle by next "case" handler ("radio")<BR> case "radio":<BR> frm.elements[x].checked = false;<BR> break;<BR> case "select-one":<BR> // handle by next "case" handler ("select-multiple")<BR> case "select-multiple":<BR> frm.elements[x].selectedIndex = -1;<BR> break;<BR> default:<BR> break;<BR> }<BR> }<BR>}<BR><BR>Call it from the onClick of the button by doing:<BR>&#060;input type="Button" value="Clear" onClick="clearForm(this.form);"&#062;

Posting Permissions

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