![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: May 2005
Posts: 41
Rep Power: 0
![]() |
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?
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
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.
__________________
|
|
|
|
|
|
#3 | |
|
Programmer
Join Date: May 2005
Posts: 41
Rep Power: 0
![]() |
Quote:
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. |
|
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
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";
}
__________________
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: May 2005
Posts: 41
Rep Power: 0
![]() |
cool, that makes since thank you.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|