calling a perl script from JavaScript

Discussion in 'Perl Misc' started by Al, Aug 3, 2005.

  1. Al

    Al Guest

    I am a newbie in Perl and would really appreciate some help.

    I want to save data from a complex html complex form. I am using the
    following code in JavaSCript to change the action of my Submit Button
    "document.form1.action = x.pl". I want to redirect the program to a
    script which will save the data but I'm not sure how to pass any
    parameters to the script.

    and ot the botton of the screen I have <input type = submit value =
    submit name=Sumbit value = sumbit>

    1)how do I send any data to x.pl
    2)Will x.pl return to the original calling page


    Thanks ahead,
    Al
    Al, Aug 3, 2005
    #1
    1. Advertising

  2. Al

    Paul Lalli Guest

    Al wrote:
    > I am a newbie in Perl and would really appreciate some help.
    >
    > I want to save data from a complex html complex form. I am using the
    > following code in JavaSCript to change the action of my Submit Button
    > "document.form1.action = x.pl". I want to redirect the program to a
    > script which will save the data but I'm not sure how to pass any
    > parameters to the script.
    >
    > and ot the botton of the screen I have <input type = submit value =
    > submit name=Sumbit value = sumbit>
    >
    > 1)how do I send any data to x.pl
    > 2)Will x.pl return to the original calling page


    Neither of these questions have anything to do with Perl. Your
    questions would be the same no matter what language x.pl was written
    in.

    Please ask your question to a group that focusses on HTML, the Web, or
    Javascript. Those are the topics about which your question pertains.

    Paul Lalli
    Paul Lalli, Aug 4, 2005
    #2
    1. Advertising

  3. Al

    Al Guest

    Thanks Mr. Lalli, but I believe this is a question pertaining to Perl,
    however I am a new programmer and iff you disagree again, I will repost
    the question to another news group as you mentioned. The script with
    which I'm working is a CGI script written in perl. All of the html is
    initially received from a call to a mySQL database and held in a
    string. The HTML string is then dynamically manipulated using Perl
    functions and constructs and not printed till the end of the script to
    provide the interface. Depending on certain circumstances, I want to
    redirect the form selections to another another script which will
    write, delete to the database. My question is how to send the form
    values from one Perl script to another. Indeed I will be using
    JavaScript to receive the form values but the Perl question is how to
    send these values to another script. Is it through using the CGI
    param() function. I have had no luck with this

    Thanks,
    Allan
    Al, Aug 4, 2005
    #3
  4. Al

    Guest

    "Al" <> wrote:
    > I am a newbie in Perl and would really appreciate some help.
    >
    > I want to save data from a complex html complex form.


    "Saving" data is just a just special case of processing the form
    submission. Learn how to process form submissions in general, and then
    implement the specific processing needed to save the data.


    > I am using the
    > following code in JavaSCript to change the action of my Submit Button
    > "document.form1.action = x.pl".


    Why? If you want the data submitted to that script, why not just set the
    action that way in the original <form> element?

    > I want to redirect the program to a


    What program?

    > script which will save the data but I'm not sure how to pass any
    > parameters to the script.


    You don't have to do anything special. Just let the html form do what html
    forms were intended to do. On the server side, "use CGI" to parse the
    parameters for you.

    >
    > and ot the botton of the screen I have <input type = submit value =
    > submit name=Sumbit value = sumbit>


    Um, OK.

    >
    > 1)how do I send any data to x.pl
    > 2)Will x.pl return to the original calling page


    x.pl is a Perl script, not a web browser. what does it mean for
    a Perl script to "return to the original calling page"?

    It seems like you want to use CGI, but you have no idea what that means.
    Read up on CGI.

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
    , Aug 4, 2005
    #4
  5. Al

    ChrisO Guest

    Al wrote:

    > Thanks Mr. Lalli, but I believe this is a question pertaining to Perl,
    > however I am a new programmer and iff you disagree again, I will repost
    > the question to another news group as you mentioned. The script with
    > which I'm working is a CGI script written in perl. All of the html is
    > initially received from a call to a mySQL database and held in a
    > string. The HTML string is then dynamically manipulated using Perl
    > functions and constructs and not printed till the end of the script to
    > provide the interface. Depending on certain circumstances, I want to
    > redirect the form selections to another another script which will
    > write, delete to the database. My question is how to send the form
    > values from one Perl script to another. Indeed I will be using
    > JavaScript to receive the form values but the Perl question is how to
    > send these values to another script. Is it through using the CGI
    > param() function. I have had no luck with this


    Read up on the Perl CGI module. There are plenty of examples in that
    module documentation to get you going.

    And it may not hurt yet to post to another newsgroup since you've
    demonstrated by your question to have a very scant understanding of web
    servers, posting forms, and server side processing n general. I don't
    mean that to be ugly; I'm only saying it sounds like you could be even
    further helped to take Paul Lalli's and Xho's advice more seriously.

    -ceo
    ChrisO, Aug 7, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,773
  2. Richard Trahan

    calling Perl script from javascript

    Richard Trahan, Aug 8, 2004, in forum: Javascript
    Replies:
    5
    Views:
    135
    Richard Trahan
    Aug 8, 2004
  3. pj
    Replies:
    3
    Views:
    275
  4. kath
    Replies:
    4
    Views:
    539
    J. Gleixner
    Apr 9, 2007
  5. Yogi
    Replies:
    1
    Views:
    420
    Peter Makholm
    Sep 13, 2012
Loading...

Share This Page