Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-07-28 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls