Because what CGI.pm does is to simply print output to the STDOUT (this is the protocol of CGI itself), you can always print the needed Javascript from your program.
This should be printed somewhere inside the "head" or "body" tags. This prints a Javascript function definition, but just like a Perl subroutine definition, it is not called immediately. It must still be called from somewhere in the program.
If you still wish to use CGI.pm to generate the entire HTML output after reading this post (which I don't really recommend because I think that facade doesn't do much good), CGI.pm exposes some attributes that correspond to standard Javascript event handlers applied to HTML objects that you can use to execute custom Javascript just like the one above. You can find more information at:
Then you can do something like this to install the handler:
If you think that printing javascript text from your Perl program is very ugly, like I do, use a template system to generate the returned content rather than using the "tree-building" mode of CGI.pm (but do use CGI.pm to generate headers, capture GET/POST/COOKIE params etc. - that's good). My favourite:
I advise you to really find out more about HTML and Javascript or your concepts may not allow you to go too much further, no matter you are going the CGI.pm route, template route or some other approaches. Because Javascript is complex, I suggest you look for resources to learn on your own but definitely don't look into the Perl docs for that!
we had a power outage shortly after i registered...
so my mail server was down for a while...
could i get the email confirmation for hackware --> resent please...?
thanx...
...william.o.yates...email removed (3 Replies)
I need to send out messages to over 100 clients in my sector. I want it to pop up a dialog box letting them know to save work and log out. I have the reboot script created just need the warning please. Thanks (35 Replies)
Hi,
I have created a script which searches and replace the searched text from any file in directory.
I want to add a functionality where before replacing the text, script shows the line with the searched text and ask for user confirmation before replacing the text.
Can this be done using SED... (18 Replies)
Greetings,
I have a bunch of Solaris servers that are running Netbackup as a client. I set them up and my backup admin has confirmed that they are being backed up. But what I want to be able to do is run a command from each Solaris client to see some proof from the client side that the files... (1 Reply)
from one script invoke another script will need to do double confirmation like: 'y' and 'y'
exp:
echo 'y' | /a/b/c.sh
only input 1 'y' in the c.sh, but the c.sh required 2 'y' (twice confirmation)
is there anyway get resolve this issue?
please help (2 Replies)
Hi All,
While am deleting a file in unix by using the command rm it's deleting the file directly
IT's have to ask the user while deleting like
do you want to delete filename y or N ?
Kindly help on this.
Thanks
Thelak (2 Replies)
Hi Guru's
Am looking for linux reboot command which get executed after user confirmation .Can someone please help me with this.:confused::confused::confused: (6 Replies)
Hi,
I need to add confirmation pop up msg box before deleting the record from database, I have added following snippets to my code but its not working for me, your help will be much appreciated :
print header;
print <<EOF;
<script type="text/javascript">
function confirmOk() {
return... (0 Replies)
Discussion started by: terrykhatri531
0 Replies
10. Forum Support Area for Unregistered Users & Account Problems
Hi Folks,
I just recently registered with the username _Kaede.
Unfortunately, I didn't receive any confirmation mail also not when I changed to another address.
Help is very appreciated.
Thanks and kind regards :) (2 Replies)