develooper Front page | perl.libwww | Postings from January 2006

RE: Setting radio buttons with WWW::Mechanize

Thread Previous
From:
Dhanashri Bhate
Date:
January 1, 2006 22:32
Subject:
RE: Setting radio buttons with WWW::Mechanize
Message ID:
200601020631.AGY93944@persistent.co.in
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:hartct@gmail.com] 
Sent: Saturday, December 31, 2005 6:54 AM
To: libwww@perl.org
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


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About