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>)