Find the answer to your Linux question:
Results 1 to 3 of 3
How do we write Java Script code in PerlCGI? I have below Java Script code to fit in PerlCGI <script type="text/javascript"> <!-- function validate() { with (document.hform) { var alertMessage ...
  1. #1
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114

    How to write Java Script in PerlCGI

    How do we write Java Script code in PerlCGI?

    I have below Java Script code to fit in PerlCGI

    <script type="text/javascript">
    <!--
    function validate() {
    with (document.hform) {
    var alertMessage = "The following REQUIRED fields\nhave been left empty:\n";
    if (item.value == "") {
    alertMessage += "\nitem"
    } if (adesc.value == "") {
    alertMessage += "\nadesc"
    } if (cost.value == "") {
    alertMessage += "\ncost"
    } if (os.value == "") {
    alertMessage += "\nos"
    } if (quote.value == "") {
    alertMessage += "\nquote"
    } if (dim.value == "") {
    alertMessage += "\ndim"
    } if (pcord.value == "") {
    alertMessage += "\npcord"
    } if (pspec.value == "") {
    alertMessage += "\nPlease enter your price range"
    } if (alertMessage != "The following REQUIRED fields\nhave been left empty:\n") {
    alert(alertMessage);
    return (false);
    } return (true);
    }
    }
    // -->
    Switched to Scripting

  2. #2
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,300
    Do you want to convert that to Perl or do you want to use Perl to output the Javascript?
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  3. #3
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114
    Quote Originally Posted by elija View Post
    Do you want to convert that to Perl or do you want to use Perl to output the Javascript?
    I want to convert that in to the perlCI so that I can validate my form before submitting
    Switched to Scripting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...