|
Posted by Amer Neely on 11/13/06 18:17
Michael Fesser wrote:
> .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
ARghhh! That's my perl coming through. '=~' is a common regex operator
for matching strings. In JS I'll have to define a variable with my pattern.
--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Navigation:
[Reply to this message]
|