Thread

Posted on Mon Apr 3 20:57:35 2006 by jeunice
submit_form() and checkboxes
I know how to use submit_form() to set normal text inputs. And I know how to use the tick/untick functions as part of a multi-function-call sequence. But I've tried a half-dozen invocations to get checkboxes set within the nearter submit_form() approach, yet none have worked. Have Google'd and RTFMed without luck. I give. What's the magic phrasing?
Direct Responses: 2098 | 7449 | Write a response
Posted on Tue Apr 4 16:48:24 2006 by cjaramilu in response to 2096
Re: submit_form() and checkboxes
to set the field call submit_form with the field set to the checkbox value.
Write a response
Posted on Tue Mar 25 11:01:40 2008 by rajar in response to 2096
Re: submit_form() and checkboxes
Hi, Default value for a checkbox is 'on' and 'off' . So, you can simply try
mechanize->submit_form(form_name => 'environment_modify', fields => { 'envi +ronment_modify_add_host_essential_1' => 'on', }, );
"environment_modify_add_host_essential_1" is the checkbox and it is initially in 'off' state. When you turn it on it will be ticked. Thanks, Raja.
Write a response