dropdown and javascript

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
paparazia
Profound User
Posts: 25
Joined: Mon Sep 23, 2013 7:08 am
First Name: ALIMA
Last Name: SECK
Company Name: OO2
Contact:

dropdown and javascript

Post by paparazia »

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?
paparazia
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

Post by paparazia »

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?
User avatar
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:

Re: dropdown and javascript

Post by David »

paparazia
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

Post by paparazia »

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.
paparazia
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

Post by paparazia »

It is possible to use the 'onfocus'???
Scott Klement
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

Post by Scott Klement »

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.
paparazia
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

Post by paparazia »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests