Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

selecting listbox with label text

by sumo123 (Initiate)
on Oct 22, 2008 at 09:44 UTC ( [id://718674]=perlquestion: print w/replies, xml ) Need Help??

sumo123 has asked for the wisdom of the Perl Monks concerning the following question:

I am using www::mechanize for selecting value in a listbox. I am using this command:
$mech->get( $url ); $mech->field("CATEGORY_ID" => 143);
where 'CATEGORY_ID' is a list box I am able to select the field using this value such as 143, but I want to select using label of the listbox. for eg if 'Internet' option has value 143, I should select using the label. as I don't know the values of different categories. Please help if somebody can. The list box is the same as mentioned here:
List Box example I would be highly thankful to you.

Replies are listed 'Best First'.
Re: selecting listbox with label text
by jonadab (Parson) on Oct 22, 2008 at 11:50 UTC

    If by label you mean an actual label element, its for attribute would contain the id of the thing it's a label for, which you can then look up by id presumably.

    If that's not what you're talking about, Anonymous Monk is probably right, and you need to show us (preferably just the relevant parts of) the HTML, so we can understand what you are saying.

    The word listbox, for instance, reminds me of my encounters with Visual Basic in the early nineties, but HTML doesn't have that type of widget. Are you talking about a select element? That's more like a drop-down list than a listbox...

    -- 
    We're working on a six-year set of freely redistributable Vacation Bible School materials.
Re: selecting listbox with label text
by Anonymous Monk on Oct 22, 2008 at 11:19 UTC
    listbox? label? You need to show some html (don't forget to use <code> tags </code>)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found