cgi javascript

Posted on 2005-04-20
Medium Priority
Last Modified: 2013-12-25
i have  following cgi script:

use CGI;
print "Content-type: text/html\n\n";

print "<html>
                     function view() {

             <BODY bgColor=\"edede2\">
                 <form name=change>
                        <input type=\"Submit\" value=\"Update\" onclick=\"view()\"> </input>

is it possible if someone clicks view button instead of opening a new page service.cgi  can i  call a subroutine within this page.
this is just to prevent creating an additional file
Question by:shahrahulb
LVL 48

Accepted Solution

Tintin earned 1000 total points
ID: 13829123
Just get rid of the Javascript and make it a standard HTML with the script handling whatever you have in service.cgi

LVL 51

Assisted Solution

ahoffmann earned 1000 total points
ID: 13831356
> is it possible if someone clicks view button instead of opening a new page service.cgi  can i  call a subroutine within this page.

simply use following link (better with HTML and not that ugly JavaScript:)


then prepare your service.cgi to handle the given QUERY_STRING and call the subroutine. I highly recommend to use a constant string for "your-subroutine" and map it to the call in your CGI (for security reason).

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question