in reply to Re: Mechanize hidden fields
in thread Mechanize hidden fields

im sorry i posted the question like an ass without reading about the __viewstate thing.. the code is simple
$mech->click_button(name => 'ctl00$Main$Send_Button');
the error is
No clickable input with name ctl00$Main$Send_Button at /usr/lib/perl5/ +site_perl/5.8.8/WWW/Mechanize.pm line 1461
ive read about the postback and what i know so far is that i have to get the value of the __viewstate, __eventvalidation, select the Main send button value and submit the form however i dont know how to get the value of __eventstate which would be something like this
value="/wEPDwUKMTg1MjcyMzgzMw9kFgJmD2QWAgIBD2QWAgIBD2QWAgIGD2QWAmYPFgI +eA2FsdAURUG93ZXJlZCBieSBHb29nbGVkGAEFFWN0bDAwJE1haW4kTXVsdGlWaWV3MQ8P +ZGZk" />
from what ive read it should be $vs =~ and then the pattern match which i dont know how to do

Replies are listed 'Best First'.
Re^3: Mechanize hidden fields
by friedo (Prior) on Apr 14, 2007 at 05:01 UTC
    $mech->click_button(name => 'ctl00$Main$Send_Button');

    Is the name of the submit button literally 'ctl00$Main$Send_Button' ? Or are $Main and $Send_Button variables? Variables do not interpolate inside single quotes.

    ive read about the postback and what i know so far is that i have to get the value of the __viewstate, __eventvalidation, select the Main send button value and submit the form however i dont know how to get the value of __eventstate which would be something like this
    Again, Mechanize shouldn't change the values of form fields that are there already. If you need to extract the values of existing form fields, use my $viewstate = $mech->value( '__VIEWSTATE' );

      ok i got it thank you for your help