Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > calling a perl script from JavaScript

Reply
Thread Tools

calling a perl script from JavaScript

 
 
Al
Guest
Posts: n/a
 
      08-03-2005

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

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      08-03-2005
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

 
Reply With Quote
 
 
 
 
Al
Guest
Posts: n/a
 
      08-04-2005
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

 
Reply With Quote
 
xhoster@gmail.com
Guest
Posts: n/a
 
      08-04-2005
"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
 
Reply With Quote
 
ChrisO
Guest
Posts: n/a
 
      08-07-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ calling perl script - Not able to get the stack arguments pushedrom XPUSH in perl script Yogi Perl Misc 1 09-13-2012 11:30 AM
what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server? kath Perl Misc 4 04-09-2007 09:21 PM
calling Perl script from javascript Richard Trahan Javascript 5 08-08-2004 06:40 PM
problem calling perl script from SOAP server perl script pj Perl Misc 3 04-09-2004 10:23 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57