Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: CGI button -onClick not working

by AlexTape (Monk)
on Sep 28, 2011 at 14:03 UTC ( #928334=note: print w/ replies, xml ) Need Help??

in reply to CGI button -onClick not working

perhaps -onclick=>"parent.location.href=\'first.cgi\';"
itīs not a perl problem.. itīs nescience about javascript..

$perlig =~ s/pec/cep/g if 'errors expected';

Comment on Re: CGI button -onClick not working
Replies are listed 'Best First'.
Re^2: CGI button -onClick not working
by tarunkhanna (Novice) on Sep 29, 2011 at 05:38 UTC
    #!/usr/bin/perl use CGI; $co = new CGI; print $co->header; print $co->start_html(); print $co->center($co->h1('Press button')); print $co->image_button(-name=>'button',-src=>'../../../icons/dir.gif' +,-onclick=>"displayHello()"); print $co->end_html; sub displayHello() { print "hello"; }
    Please Correct this code...Clicking the button not working. It works if I put some cgi script and "parent.location.href" along with that as you mentioned.
        Yeah, I know that perl doesn't run in the browser. But the point is, I want to run a function when I click the button. How to do that??

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2015-11-28 19:16 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls