Linked pulldown lists using MySQL, PHP/JavaScript/Ajax/jQuery

OnCoke

New Member
I am quite new to web development and have a task to develop a web application that will basically show the user 5-15 pull down lists on one page, where each selection will limit the choices in all other lists. The user should be able to start with any one of the lists (so no set selection order) and when the user have selected something in each list or all parameters are otherwise locked by previous choices the user has to press the GO button and some calculations will take place, presenting a database selection. Basically it is a muliple parameter product selector application.The relations between the lists are not simple, and could need calculated fields etc, and one list could affect the content of several others. The database behind will be MYSQL, probably a single large table, with perhaps 30 fields and 500-5000 rows. I will be using PHP, JavaScript and perhaps AJAX unless you have a strong reason not to.I have done some research and found three ways to do this:[*]Send all data to the browser and handle the filtering etc client side with Javascript.[*]Send parameters back to the server after each selection and reload the whole form after each selection. Probably a littebit Javascript and most code in PHP. [*]Use AJAX to change all list content dynamically without reloading the whole form. Since I am so new to this I have a hard time telling which way to go, what pitfalls there are etc...I have some conserns:A. Slow initial loading. Worst for #1?B. Slow dynamic response. Worst for #2?C. Complicated programming. Worst for #3?D. Compatibility issues for different browsers and plattforms. Have no idea of which method is most likely to create problems...better if I use some Framework?E. Could I even try to make something at least part-working for people with javascript turned off? (like selecting each list on a new page and having to press GO button each time)? (I think I can tell my users they must have Javascript on so no big issue....) Perhaps #2 is best here?F. I think the specification of "free selection order" means I have to download most of the database initially, so perhaps I should try to avoid that option.....if I keep it I might as well use method #1, or???G. It would be best to do as much as possible of the selction/filtering in SQL to allow future extensions by building custom SQL code, so that gives a big minus to #1...H. Other pitfalls etc???I have found tutorials etc for all three methods, but if you can point to good resources like this I would appreciate it, especially so I dont base my code on examples that are not smart/good/compatible....1:http://www.bobbyvandersluis.com/articles/unobtrusivedynamicselect.phphttp://javascript.about.com/library/bl3drop.htmhttp://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_20523133.html2:http://www.plus2net.com/php_tutorial/php_drop_down_list.phphttp://www.plus2net.com/php_tutorial/php_drop_down_list3.php3:http://techinitiatives.blogspot.com/2007/01/dynamic-dropdown-list-using-ajax_29.htmlhttp://www.webmonkey.com/tutorial/Build_an_Ajax_Dropdown_Menuhttp://www.noboxmedia.com/massive-ajax-countryarea-drop-down-list/http://freeajaxscripts.net/tutorials/Tutorials/ajax/view/Create_AJAX_Dynamic_Drop_Down_List_using_PHP_-_xajax.html3+jQuery:http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/Now to the question: Could anyone experienced in all these methods help me out a bit, with the evaluation of methods 1-3 above so I can choose one and get started on the right track? Also, will I be helped by learning/unsing a framework like jQuery+jSON for this?RgdsPM
 
Top