Hi Tom,
Thanks for your reply. (I am a big fan)
In fact I did read that FAQ. But missed the point actually. I made up
in my mind that warnings should be cured at all times, not ignored/
suppressed. But it makes sense turning off warning for that block.
And it solves my problem.
I was thinking of going for more complex solutions. Like deleting the
hidden fields and replacing them with textboxes with value, then
submitting the form. :-? But my head is healthy again.
--Sumon
On Jun 23, 11:49 pm, [EMAIL PROTECTED] (Tom Phoenix) wrote:
> On 6/23/07, skywriter14 <[EMAIL PROTECTED]> wrote:
>
> > I have been trying to set some hidden form fields with
> > WWW::Mechanize, but I get error that they are read only.
>
> Have you seen this entry in the FAQ?
>
> Why do I get "Input 'fieldname' is readonly"?
>
> You're trying to change the value of a hidden field and you
> have warnings on.
>
> First, make sure that you actually mean to change the field
> that you're changing, and that you don't have a typo. Usually,
> hidden variables are set by the site you're working on for a
> reason. If you change the value, you might be breaking some
> functionality by faking it out.
>
> If you really do want to change a hidden value, make the
> changes in a scope that has warnings turned off:
>
> {
> local $^W = 0;
> $agent->field( name => $value );
> }
>
> I found the FAQ here:
>
> http://search.cpan.org/dist/WWW-Mechanize/lib/WWW/Mechanize/FAQ.pod
>
> Hope this helps!
>
> --Tom Phoenix
> Stonehenge Perl Training
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/