i need to allow the user to select a top level category from one select box and to automatically populate the sub-category.. etc how can i handle big data like eBay in select tags how can i do that with easy way?
handle large data by ajax
Collapse
X
-
Comment
-
Since you want achieve this via Ajax and you haven't specified any framework, and assuming you know how to use Ajax, all you need is to pass the top level category as a parameter to a server-side script which runs a query and gets all the sub-categories. These can be output as XML or using a suitable delimiter. On the client-side on receiving the response, parse it to get all the categories. You can use the add() method, or the options[] array to insert a new option.Originally posted by smartici need to allow the user to select a top level category from one select box and to automatically populate the sub-category.. etc how can i handle big data like eBay in select tags how can i do that with easy way?
Make an attempt and if you get stuck, post your code.Comment
-
i have sone something similar. if you are just html and javascript on the client side you need to have the ajax return either the outterHTML of the select you are working with (innerHTML if FireFox) you cant return objects to add to the select because IE cant handle that much manipulation.Comment
-
...or innerHTML for all browsersOriginally posted by jcumolettiif you are just html and javascript on the client side you need to have the ajax return either the outterHTML of the select you are working with (innerHTML if FireFox)Strings should be OK, which can be added as option objects/elements.Originally posted by jcumolettiyou cant return objects to add to the select because IE cant handle that much manipulation.Comment
Comment