validation questions

Results 1 to 2 of 2

Thread: validation questions

  1. #1
    Join Date
    Dec 1969

    Default validation questions

    i got textboxes with the ff. name convention:<BR><BR>p_quantity1,p_quantity2,& so on<BR><BR>how can i validate them using a for loop with javascript? i&#039;ve been trying this code out but it wont work. got any ideas? thanks!<BR><BR>for(b=0 ; b&#060;varnum ; b++)<BR>{<BR>alert(document.form1.p_quantity[b].value);<BR>varTemp1 = varTemp1 + parseFloat(document.form1.p_quantity[b].value);<BR>}

  2. #2
    Join Date
    Dec 1969

    Default RE: validation questions

    &#060;script&#062;<BR>for(var b=0 ; b&#060;varnum ; b++){<BR> varTemp1 = varTemp1 + parseFloat(document.form1["p_quantity" + b].value);<BR>} <BR>&#060;/script&#062;<BR><BR>There are different methods of accessing the form&#039;s elements - maybe you should have a quick read up on them?<BR><BR>Craig.

Posting Permissions

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