|  | Posted by Michael Fesser on 11/13/06 17:48 
..oO(Amer Neely)
 >When you say it 'work's, does that mean your PHP tells you upon form
 >submission which boxes were checked?
 
 Yep. The problem with your script was the operator '=~', which doesn't
 exist in JS. Use a '==' and it works.
 
 >Mine works fine IF AND ONLY IF I
 >check the boxes with the mouse, even though the JS code will toggle them
 >on or off perfectly.
 
 The problem was this part:
 
 document.forms[0].elements[i].name =~ 'DeleteThis'
 
 '=~' is not an operator recognized by JS. It is interpreted as an
 assignment operator, followed by a bitwise negation of its operand!
 
 I don't know for sure what the JS engine does if you try to negate a
 string, but it look as if it's casted to an integer first, which is 0 in
 this case. After bitwise negation it became -1 (two's complement), which
 then got assigned to each control's name. A simple
 
 var_dump($_POST);
 
 at the beginning of the PHP script shows that.
 
 Micha
  Navigation: [Reply to this message] |