simple error

Results 1 to 2 of 2

Thread: simple error

  1. #1
    Join Date
    Dec 1969

    Default simple error

    I have this js which i am calling on a button and when users click on the button it will checked all the checkboxes it is working ok but when I press the button again it unchecks them all..rather it should work that the button always make them checked even they are already checked<BR><BR>function check(field) {<BR><BR>for(i=0; i&#060; field.length; i++)<BR> {<BR> var tempobj = field.elements[i];<BR> if (tempobj.type == "checkbox") <BR> <BR> if (tempobj.checked==false)<BR> {<BR> tempobj.checked=true<BR> }<BR> <BR> }<BR><BR>}<BR><BR>any ideas what am i doin wrong

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: simple error

    This code you have will NOT uncheck the checkboxes the onlythign happeningis you MAY be submitting the form to itself and then next time it loads the checkboxes are not checked<BR><BR>

Posting Permissions

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