RE: Setting radio buttons with WWW::Mechanize

"Dhanashri Bhate" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Organization Persistent Systems
Message-ID <[email protected]>
Hi,
Lets see one example. 

Suppose a page asks user preference of either text or HTML for opening
something. So the form will show 2 buttons and associated text may be "Text"
and "HTML". And a button "Select". 

The values associated with the radio buttons may be different that this
text. You can get the radio button field name and values from the HTML
source. ( the way I do it is open the webpage in Mozilla and see Page Info,
this will clearly show you the radio button info i.e. name and values ) 

So say in this case, the radio button field "filetype" can have any of these
two values "txt" and "htm" .

Then to select option "Text", your code will have the following:

$mech->submit_form(	
form_number => 1,
fields      => { filetype=>'txt'},
button	=> 'Select',
);


-----Original Message-----
From: Christopher Hart [mailto:[email protected]] 
Sent: Saturday, December 31, 2005 6:54 AM
To: [email protected]
Subject: Setting radio buttons with WWW::Mechanize

I feel like this is a dumb question, but I haven't been able to figure
it out:  How does one set the value of radio buttons using
WWW::Mechanize?

Thanks,
Chris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.