Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Click on Radio Button by www::Mechanize [All buttons have same "value" but different "id" and "Onclick" Value.]

by Matt™ (Acolyte)
on Oct 19, 2012 at 14:00 UTC ( #999930=perlquestion: print w/ replies, xml ) Need Help??
Matt™ has asked for the wisdom of the Perl Monks concerning the following question:

Seeking your wisdom Monks,

I have to click a radio button(code is provided below). The problem is that the Radio buttons are having same "Value" :( and bcoz of that i am unable to do it in the conventional way. but the buttons are having a different "id". So my humble question is that how can make it to click. (I have an alternate way to go by getting the URL directly, but i need to do it in the $mech->field or set_visible way, as i have permission to do it in that way only.. Is there any chance for that..?

Thanks in advance Monks !

<label for="date">Date <input type="radio" class="radio" id="date" name="sort" value="Y" oncl +ick="change_search_format('/cgi-bin/advsearch?reord=D&amp;lr=&amp;rep +eat_search=Y&amp;agency_group_id=&amp;vac_group_id=&amp;agency_id=&am +p;vr=&amp;agency_group_id=&amp;agency_id=&amp;vr=');"></label> <label for="salary">Salary <input type="radio" class="radio" id="salary" name="sort" value="Y" on +click="change_search_format('/cgi-bin/advsearch?reord=S&amp;lr=&amp;r +epeat_search=Y&amp;agency_group_id=&amp;vac_group_id=&amp;agency_id=& +amp;vr=');"></label> <label for="relevance">Relevance <input type="radio" class="radio" id="relevance" name="sort" value="Y" + checked="checked" onclick="change_search_format('/cgi-bin/advsearch? +reord=R&amp;lr=&amp;repeat_search=Y&amp;agency_group_id=&amp;vac_grou +p_id=&amp;agency_id=&amp;vr=');"></label>

Comment on Click on Radio Button by www::Mechanize [All buttons have same "value" but different "id" and "Onclick" Value.]
Download Code
Re: Click on Radio Button by www::Mechanize [All buttons have same "value" but different "id" and "Onclick" Value.]
by Corion (Pope) on Oct 19, 2012 at 14:27 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://999930]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2014-08-20 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls