Pass on values from drop-down box

N

nazgulero

Hello all,

I wonder if anybody can give me a hint about what I have to do to get
this working: I am creating a drop down box using the script below. The
result is two text fields; now I want to pass those values, which come
from the drop down box, to the next page. The next page should then
simply look like this:

Month:

Year:

And the values should be the ones from the drop-down box...
I have been staring myself blind about how to get this accomplished.
Would be more than grateful if somebody could have a look...here is
what I got so far:

<script language="JavaScript"><!--
function setForm2Value() {
var selectedItem = document.formName1.selectName1.selectedIndex;
var selectedItemValue =
document.formName1.selectName1.options[selectedItem].value;
var selectedItemText =
document.formName1.selectName1.options[selectedItem].text;

if (selectedItem != 0) {
document.formName2.textboxName1.value = selectedItemText;
document.formName2.textboxName2.value = selectedItemValue;
}
else {
document.formName2.textboxName1.value = "";
document.formName2.textboxName2.value = "";
}
}
//--></script>
Incident Level <br>
<form name="formName1">
<select name="selectName1" onChange="setForm2Value()">
<option>Make A Selection:
<option value="2000">January
<option value="2001">February
<option value="2002">March
</select>
</form>

<p>

<form name="formName2" method="POST" action="step2.htm">
<input type="text" name="textboxName1" value="" size="20"> Euro
<input type="text" name="textboxName2" value="" size="6">
<input type="submit" VALUE="Next" class=button>
</FORM>

This creates the drop down list, and when a selection is made, two
textboxes at the bottom are filled. When I hit the ´Next´ button,
that takes me to the new page. So far, so good. The problem is: how do
I get the values from those two textboxes to two new text fields on the
new page ? I have been staring at this for the last two days, and tried
about everything I could find in sample codes, but I must be doing
something wrong, because the values do not appear on the new page. Can
anybody provide me with a hint, or better yet, some sample code ?
Thanks a bunch in advance !

Naz
 
V

Viator

Is there any server side programming framework (ASP, JSP etc) involved
in this.

Amit :)
 
A

ANKZ

hi buddy
i did not have the time to write the code but i will give yu the basic
outline how to do it
give some name to the text box in the name parameter
and in the next page u can use the function request.getparameter
function to get the parameter values and the assgin them to a variable
u can search for use of request .getparameter function on net to get
its exact syntax
if u donnot understand
write to me i will then send u the code
ankz
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top