hi, i have two dropdown fields, in the first i have countries and the data of the second depend on the choices of the first.
but in the first, i have some contries without city in the second and i want that the second dropdown appears only if the contry have some city?
how can i di it?
dropdown and javascript
-
- Profound User
- Posts: 25
- Joined: Mon Sep 23, 2013 7:08 am
- First Name: ALIMA
- Last Name: SECK
- Company Name: OO2
- Contact:
-
- Profound User
- Posts: 25
- Joined: Mon Sep 23, 2013 7:08 am
- First Name: ALIMA
- Last Name: SECK
- Company Name: OO2
- Contact:
Re: dropdown and javascript
Actually I would like to bring up the second dropdown when the user selects the first list a country that has cities in the second list.
Otherwise, the second list should not be visible ..
is not it I have to use javascript? but how?
Otherwise, the second list should not be visible ..
is not it I have to use javascript? but how?
- David
- Profound Logic Staff Member
- Posts: 690
- Joined: Fri Jan 04, 2008 12:11 pm
- First Name: David
- Last Name: Russo
- Company Name: Profound Logic Software
- Contact:
-
- Profound User
- Posts: 25
- Joined: Mon Sep 23, 2013 7:08 am
- First Name: ALIMA
- Last Name: SECK
- Company Name: OO2
- Contact:
Re: dropdown and javascript
thank you David, I came to link the two drop-down lists, cities of the second list is loaded from the selected in the first list of countries .... but now I want that when the user selects a country without city the second dropdown, it does not appear or is inactive.
-
- Profound User
- Posts: 25
- Joined: Mon Sep 23, 2013 7:08 am
- First Name: ALIMA
- Last Name: SECK
- Company Name: OO2
- Contact:
Re: dropdown and javascript
It is possible to use the 'onfocus'???
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: dropdown and javascript
I don't see why you'd use onfocus, here?
If you are loading the dropdowns from an RPG program, whether it's empty or not should be known at the time the screen is drawn, so I would use an onload event to disable/enable the dropdown based on whether there is any data in it.
If you are loading them from JavaScript, then I would just add the enable/disable to the end of that JavaScript code.
If they are database-driven, that might make it trickier.
If you are loading the dropdowns from an RPG program, whether it's empty or not should be known at the time the screen is drawn, so I would use an onload event to disable/enable the dropdown based on whether there is any data in it.
If you are loading them from JavaScript, then I would just add the enable/disable to the end of that JavaScript code.
If they are database-driven, that might make it trickier.
-
- Profound User
- Posts: 25
- Joined: Mon Sep 23, 2013 7:08 am
- First Name: ALIMA
- Last Name: SECK
- Company Name: OO2
- Contact:
Re: dropdown and javascript
sorry Scott, i see that it's not possible to use the onfocus
Data drop-down lists are loaded from two tables. And the data is displayed correctly. But if the country selected have'nt data in the second list, I want the second list to be disabled.
Data drop-down lists are loaded from two tables. And the data is displayed correctly. But if the country selected have'nt data in the second list, I want the second list to be disabled.
Who is online
Users browsing this forum: No registered users and 0 guests