calling a perl script from JavaScript

A

Al

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
 
P

Paul Lalli

Al said:
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
 
A

Al

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
 
X

xhoster

Al said:
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 said:
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
 
C

ChrisO

Al said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top