Digimer has asked for the wisdom of the Perl Monks concerning the following question:
And the 'clicksel' JS function is:<input type="checkbox" name="selrow0" value=" " onclick="clicksel(this +)">
As I understand it, the JS sets the value of the checkbox to the name of the checkbox that was ticked and unchecks any others. However, looking through WWW::Mechanize (and HTML::Form) it looks like it expects the input value (space, in this case). Why didn't they use radio? Anyway...function clicksel( itm ) { if (itm.checked) { if ((document._LocationSelection.sel.value != itm.name ) && ( +document._LocationSelection.sel.value != "")) { box = eval("document._LocationSelection." + document._Loca +tionSelection.sel.value); box.checked = false; } else { document._LocationSelection.sel.value = itm.name; } } else if (document._LocationSelection.sel.value == itm.name) { document._LocationSelection.sel.value = ""; } }
And several variants of cause an error like this:my $input = $agent->current_form->find_input("selrow0", 'checkbox', 0) +; $input->value("selrow0");
The '$input->value("selrow0");' being line 285 in this example.Illegal value 'selrow0' for field 'selrow0' at ./check_avail.lib line +285
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ticking checkboxes in WWW::Mechanize, with a twist
by NetWallah (Canon) on Sep 13, 2008 at 17:34 UTC | |
by Digimer (Initiate) on Sep 14, 2008 at 01:28 UTC |