cgi javascript

Posted on 2005-04-20
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

    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

    > 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).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
    JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now