JavaScript/HTML passing info from one form to another

Hi…I am a newbie in JavaScript.I have two forms (in two different webpages) all with radio buttons. A user cannot select more than one option from each form. My plan is to pass the user input from both the forms to a perl script which would then query a MySQL db for the output and display it.
Now my question is, is it possible to pass the data from first form to second using GET/POST method in Radio form? Will it be possible to pass both data from first and second form into the Perl code?
My first form page named as index.html page and the second one is named as party_names.html.
The form code I used in the first index.html page is:

<form action="party_names.html" method=post name="Candidate_name" ENCTYPE= text/plain onsubmit="return form_validation(this)">

I have a JavaScript function to validate form data so that it can check whether a radio button is selected after clicking next button to go to next html form page. Please suggest.
Many thanks in advance…

You can pass from the first to the second using the GET protocol so that JavaScript can retrieve the values and load them in to hidden form fields, but then you are guaranteeing that the form will only with for people with scripting enabled.

The better way is to submit the form to server-side code, so that you can retrieve the submitted form data (as either POST or GET) and put the values in hidden form fields or in session data for the next page.

Hi thanks for your reply. Basically I will supply the variables in Perl at the end to interact with MySQL DB with my variables. My second form will have a code like this

<FORM action="myscript.pl" method=POST

…But for that I want to make sure that user selected variables (from two different forms) are going to pass to the script. So you’re saying that the GET or POST in both forms will serve the purpose. Am I rite?
So the code parts I given in my earlier post and in this post are correct?
Thanks again for your reply…

First you need to get the submitted form values from the first page, to show up in the second page. If server-side code will be receiving the submitted form from the second page, then using POST will work well.

No… server side code (in my case Perl script) should work with the values from both forms. Not only the second one. In this case, POST will work?

If the first page is submitted to a Perl script, and the Perl script is used to create the second page, then POST is good to be used.

Will a Perl script be used to retrieve the first page’s submitted data?

The form value from the first page does not show up in second one. Both are different forms and used radio buttons in both forms. But I need the variables from both forms in my Perl script to work.
Thanks

Let’s work backwards then. If you require the Perl script to receive the values from both forms, that must mean that the second form has to contain the values from the first form. Preferably as hidden values in the second form, right?

The first page has a next button. So after selecting a Radio button, user clicks Next butto and goes to the next Form and selects a Radio button from a different form. Now I want the selections from both forms to be passed in Perl.
So my first page contains this code:

<form action=“party_names.html” method=post name=“Candidate_name” ENCTYPE= text/plain onsubmit=“return form_validation(this)”>

and it takes me to the secnd page and the second page has a submit button to go to Perl script…
Thanks

that must mean that the second form has to contain the values from the first form. Preferably as hidden values in the second form, right?

Yes… right

Okay, good. So you need a way to modify the second form so that the first-form values are added to it.

With JavaScript that can only be done as a GET submission, and it is guaranteed to fail when client-side scripting is not available.

With server-side code, you can use either GET or POST submissions, and it’s guaranteed to work regardless of whether clisnet-side scripting is supported or not.

Should I send you all the codes?

Okay, good. So you need a way to modify the second form so that the first-form values are added to it.

With JavaScript that can only be done as a GET submission, and it is guaranteed to fail when client-side scripting is not available.
With server-side code, you can use either GET or POST submissions, and it’s guaranteed to work regardless of whether client-side scripting is supported or not.

No. I don’t do any work for you. Instead I will help you to find the answers for yourself.

Actually I wanted to send you only the codes of the Form part…
but I think I am getting it now…I should work with POST method then…
Thanks a lot for your help…