Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 3rd, 2005, 10:41 AM   #1
MrSmiley
Programmer
 
MrSmiley's Avatar
 
Join Date: May 2005
Posts: 41
Rep Power: 0 MrSmiley is on a distinguished road
JSP select onChange()

Ok, I have a problem, I have a list of 50 states and 1 province in a select box. In this box, if they choose Kansas it is to bring up a hidden feild for county, else they get a different feild for county. Does anyone know how to do this?
MrSmiley is offline   Reply With Quote
Old Nov 3rd, 2005, 1:41 PM   #2
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Yes, but you are talking about JavaScript not JSP (Java Server Pages). So a moderator should move your post to the proper category...

But anyway, show me what HTML and/or JS code you have so far and i'll try and help you.
__________________

tempest is offline   Reply With Quote
Old Nov 4th, 2005, 1:03 AM   #3
MrSmiley
Programmer
 
MrSmiley's Avatar
 
Join Date: May 2005
Posts: 41
Rep Power: 0 MrSmiley is on a distinguished road
Quote:
Originally Posted by tempest
Yes, but you are talking about JavaScript not JSP (Java Server Pages). So a moderator should move your post to the proper category...

But anyway, show me what HTML and/or JS code you have so far and i'll try and help you.
Saddly, I cannot show you the code due to it is for work (NDA). But the algorithm goes something like this (should draw up a UML design).

we have file StateList.java where case 32 is Kansas
then we have a loop that returns all these names to the select box.
I want, if this select box is on kansas then I want a hidden feild (another select box with countys in it) to appear. This does a lot more then it says, but what I need to know is given in that information.
MrSmiley is offline   Reply With Quote
Old Nov 4th, 2005, 6:32 AM   #4
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
it's basically playing with these commands

document.forms["form_name"]["state_select"].onchange = function() {
if(document.forms["form_name"]["state_select"].options[document.forms["form_name"]["state_select"].selectedIndex].value]== "kansas") 
	document.forms["form_name"]["country_select"].style.display = "block";
}
__________________

tempest is offline   Reply With Quote
Old Nov 4th, 2005, 8:41 PM   #5
MrSmiley
Programmer
 
MrSmiley's Avatar
 
Join Date: May 2005
Posts: 41
Rep Power: 0 MrSmiley is on a distinguished road
cool, that makes since thank you.
MrSmiley is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:24 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC