Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Follow-up Javascript Hyperlink

by Anonymous Monk
on Jul 13, 2007 at 04:26 UTC ( [id://626365]=note: print w/replies, xml ) Need Help??


in reply to Follow-up Javascript Hyperlink

I created this routine to deal with this situation and do cut/paste/modify from javascript to code
sub doPostBack { my $agent = shift; ## WWW::Mechanize agent-object passed in my $target = shift; ## first argument in the __doPostBack() cal +l in javascript my $arg = shift; ## second argument in the __doPostBack() ca +ll 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(); # }

Replies are listed 'Best First'.
Re^2: Follow-up Javascript Hyperlink
by jiperez (Initiate) on Feb 14, 2012 at 14:08 UTC
    Thanks for your routine!!! Has been really useful!!
Re^2: Follow-up Javascript Hyperlink
by enemyofthestate (Monk) on Jan 08, 2014 at 23:18 UTC
    That explained a LOT of things -- Thank you!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://626365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found