Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Pass on values from drop-down box

Thread view: 
nazgulero - 25 Nov 2005 06:49 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.