Tim <[EMAIL PROTECTED]> writes:

> I have a website written in PHP/MySQL.
> 
> I'm using www::mechanize and www::mechanize::formfiller to test the site.
> 
> I declare one of the form fields as an array in PHP like so:
> 
>      echo "<input type=\"checkbox\" name=\"cat[]\"
> value=\"$cat_id\">".VarPrepForDisplay($title)."";
> 
> which in turn creates the following HTML code that www::mechanize uses
> to test the code.
> 
>        <input type="checkbox" name="cat[]" value="164">
> 
> 
> this makes the cat field an array. the problem is that when I try to
> use www::mechanize to submit values to this filed I get the following
> error:
> 
> Illegal value '211' for field 'cat[]' at /path.pl line 89
> 
> Does anyone know how I can submit values to an array based form field?

I don't know what it takes in WWW::Mechanize land, but if you have
access to the HTML::Form object you can do this:

   $form->param("cat[]", 211, 213);

This will turn on the "211" and "213" check box and all the other
"cat[]" checkboxes off.

Regards,
Gisle

Reply via email to