some javascript stuff

Results 1 to 2 of 2

Thread: some javascript stuff

  1. #1
    Join Date
    Dec 1969

    Default some javascript stuff

    hi friends,<BR><BR>I would like to check for duplication of part_number entry in my form. I have dynamic generation of rows of part_number so the number of rows can vary from 1 to 1000 .<BR>The below written script works fine except that after the first few rows say 5 it does not work for exemple if i repeat row 3 and 4 it works fine but if i repeat row 14 and 15 with the same valuse it does not validate and simply submit. any suggestions ?<BR>ps: the name of the part_numbers are as<BR>part_number1<BR>part_number2<BR>part_number3 and so on...<BR>Thanks in advance<BR>Regards,<BR>Nilabdhi<BR><BR>function checkparts()<BR>{<BR> var part = document.thisForm.part_number1.value;<BR> for(j=2;j&#060;=document.thisForm.rows.value;j++)< BR> {<BR> if (part == document.thisForm[&#039;part_number&#039; + j].value)<BR> {<BR> alert("You have added some duplicate part numbers")<BR> return false;<BR> }<BR> } <BR>}<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: some javascript stuff

    I am wondering -- how are you determining document.thisForm.rows.value? Have you tried using the alert() function to see what this value is?<BR><BR>alert(document.thisForm.rows.value);<BR ><BR>You may find that this value isn&#039;t what you want it to be.<BR><BR>HTH

Posting Permissions

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