INTJTech Posted December 8, 2011 Share Posted December 8, 2011 I am creating a form that will allow the user to select the make of vehicle "FORD" for example. If that make of vehicle is selected among different makes of vehicles, then another box will appear, with all the models for that particular model "Fiesta" for example. What type of code accomplishes this setup in my web page? I do not want to list 500 models in one drop down list, but just those for each make in the first drop down list. Thanks much! Quote Link to comment https://forums.phpfreaks.com/topic/252726-selection-in-one-drop-down-box-makes-another-drop-down-box-appear/ Share on other sites More sharing options...
Pikachu2000 Posted December 8, 2011 Share Posted December 8, 2011 If you mean without a page refresh, then you want AJAX. Quote Link to comment https://forums.phpfreaks.com/topic/252726-selection-in-one-drop-down-box-makes-another-drop-down-box-appear/#findComment-1295624 Share on other sites More sharing options...
SergeiSS Posted December 8, 2011 Share Posted December 8, 2011 It was said that you need AJAX. It's true, but there is another possibility. You may load all your data into JS arrays (I think 2-dimentional array for models), in a time, when you create a page. Then you will select and show a part of this array (model), related to one exact type of the vehicle. The benefit of this method is that you load all information just at once and don't warry about it later. In the same time, this is also a defect of this method - the total traffic will be higher for every user (in comparison with AJAX). Quote Link to comment https://forums.phpfreaks.com/topic/252726-selection-in-one-drop-down-box-makes-another-drop-down-box-appear/#findComment-1295632 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.