Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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
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 perusing the Monastery: (6)
As of 2014-09-20 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (158 votes), past polls