Results 1 to 2 of 2

Thread: looping

  1. #1
    Join Date
    Dec 1969

    Default looping

    I am trying to set clear the values of a number of input boxes using the following code.<BR><BR> &#060;script language=javascript&#062;<BR> function Display() {<BR><BR> var count = 0<BR> for (count=1; count &#060;=55; count++)<BR> {<BR> document.form.inputbox[count].value = "";<BR> }<BR> } <BR> &#060;/script&#062;<BR><BR>Have you got any suggestions as to what I am doing wrong?<BR>Many thanks.

  2. #2
    Arky Guest

    Default RE: looping

    try this<BR><BR>var doc = eval("document.form.inputbox" + count)<BR>doc.value="";<BR><BR>are you sure the inputboxes are called <BR><BR>inputbox1, inputbox2...inputbox55<BR>if so the code above should work<BR><BR>Arky

Posting Permissions

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