Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
post_category is a checkbox field with a name shared with lots of other checkboxes. They are all numerically named though, so there is a post_category[] checkbox with a value of 1, just like there is of 2 and 3. I need to create just the checkboxes for those listed in $cats in the above example. They are comma and space separated. Let's pretend..my @cats = split(", ", $email_cat); $mech->submit_form( form_name =>'post', fields => { 'post_title' => '', 'post_category[]' => '' } );
How do I make the number of post_category references dynamic to the size and values of my @cats? I hope this makes sense butmy @cats = (1, 2, 5, 10, 44);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Easiest way to dynamically add fields to mechanize
by Anonymous Monk on Mar 21, 2011 at 21:15 UTC | |
|
Re: Easiest way to dynamically add fields to mechanize
by ikegami (Patriarch) on Mar 21, 2011 at 21:41 UTC | |
|
Re: Easiest way to dynamically add fields to mechanize
by Anonymous Monk on Mar 21, 2011 at 23:50 UTC | |
by Anonymous Monk on Mar 22, 2011 at 01:06 UTC |