Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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';

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2018-05-25 01:55 GMT
Find Nodes?
    Voting Booth?