Hi Peter,

Thank you for the help. I just had time to try it, was working on other
stuff.

Anyway, find_input doesn't work either. My code :

  $form = $mech -> form_name(Form1);
  @inputs = $form -> find_input();
  foreach $input ( @inputs) {
         print ">>$input->{name}<<\n";
  }

only prints the input text boxes and selects that has option tags in
between. The input select box I try to use is 

< select name="productSearch1:lbCategories" size="10" multiple="multiple"
id="productSearch1_lbCategories" class="urun_arama_field"
OnChange="lbCategories_onChange();" style="width:150px;" >
< / select >

So find_input doesn't get it:(

I can't use $input->value($new_value) on this undefined input. 

I think I'll give up using mech and do my job manually for this site:)

Thank you anyway.

B.



-----Original Message-----
From: Peter Stevens [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 15, 2004 1:16 PM
To: Burcu Gümüş Demokan
Cc: [EMAIL PROTECTED]
Subject: Re: can't use www:mech set_fields for a select field.

Hi Burcu.

I wish Mechanize could handle javascript. It would make some things so 
much easier!

Based on your description, it sounds like either the input field is not 
named what you think it is, or for some reason, HTML::Form doesn't want 
you to address the field by name (are there limitations to the 
characters allowed in a form name?).

You can use $form = $mech->form_name($name)  to manipulate the form 
object directly. This gives you more methods than Mechanize supports.

I would try the $input = $form->find_input method to scan through the 
input fields, then you can determine what names HTML::Form thinks are 
present or use the $input->value($new_value) method to set the field 
without using the name.

Hope this helps.

Best regards

Peter


>  
>

Reply via email to