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
Viator - 25 Nov 2005 07:08 GMT
Is there any server side programming framework (ASP, JSP etc) involved
in this.
Amit :-)
Andrew Thompson - 25 Nov 2005 08:36 GMT
...
> I wonder if anybody can give me a hint about what I have to do to get
> this working:
Yep.
> <script language="JavaScript"><!--
Talk to the experts.
<http://www.physci.org/codes/javafaq.jsp#js>

Signature
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Currently accepting short and long term contracts - on Earth.
ANKZ - 25 Nov 2005 08:39 GMT
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
> Hello all,
>
[quoted text clipped - 60 lines]
>
> Naz
chitumalla - 25 Nov 2005 17:54 GMT
Are you using any server side programming for this?.. With that it ca
be easily acheived
-----------------------------------------------------------------------
IT Interview Questions : http://www.geekinterview.com IT Tutorials and Articles : http://www.geekarticles.com Oracle and Oracle Apps Training : http://www.exforsys.com