Fouad Mokhtar Posted July 21, 2022 Share Posted July 21, 2022 Hi, I need to create two dropdown field and to be dependent to the each other.. Example Dropdown list #1 has value of cities Cairo Alex And dropdown list #2 has value of area Nasrcity (belong to cairo) Somoha (belomg to alex) I need when user select Cairo in source field (#1) it only show areas related to the selection in the target field (#2)...etc is there any module to do that or how I can achieve that please. Thanks Link to comment Share on other sites More sharing options...
Ress Posted July 21, 2022 Share Posted July 21, 2022 You can use jQuery for this. Specifically, you can use the "change" event for the first dropdown to populate the other input.https://www.w3schools.com/jquery/event_change.asp Now it also depends on where you have the data for the values in the second input. Do you load it from the database?https://www.tutorialspoint.com/how-to-populate-select-list-with-jquery Link to comment Share on other sites More sharing options...
ps8modules Posted July 22, 2022 Share Posted July 22, 2022 (edited) First of all, you have to have the data stored somewhere. You can have them either in CSV or XML or JSON or in a database. Then it's easy to program. If you don't give us the exact data, we can only speculate. Edited July 22, 2022 by 4you.software (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now