sub doPostBack { my $agent = shift; ## WWW::Mechanize agent-object passed in my $target = shift; ## first argument in the __doPostBack() call in javascript my $arg = shift; ## second argument in the __doPostBack() call in javascript # convert the passed in string $target =~ s/\$/:/g; $agent->form_number(1); $agent->field('__EVENTTARGET', $target); $agent->field('__EVENTARGUMENT', $arg); $agent->submit(); } #endsub doPostBack # function __doPostBack(eventTarget, eventArgument) { # var theform; # if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) { # theform = document.MTMMAIN; # } # else { # theform = document.forms["MTMMAIN"]; # } # theform.__EVENTTARGET.value = eventTarget.split("$").join(":"); # theform.__EVENTARGUMENT.value = eventArgument; # theform.submit(); # }