On 03/30/2007 01:20 PM, Jason Roth wrote:
I'm using www::mechanize to submit a form to a website, and one of the
fields is disabled (and enabled by javascript on the page which
obviously isn't running).  When I try to set a value for this field I
get a "no such field" error.  How to I set a value for, and enable,
disabled form fields?

Thanks,
Jason


You might have to use a lower-level interface to do this. WWW::Mechanize is built upon LWP::UserAgent, so the simple way would be to just use LWP::UserAgent to create and send the POST request.

A better but more complicated way to do it would be to use WWW::Mechanize to get the initial form. Then you'd extract the form from the WWW::Mechanize object, assign the form names and values to a hash, add your desired field to the hash, and send the POST request using LWP::UserAgent.

Good luck.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to