Hello Jason,
I used Prototype.js to build this chained selector. My flow is basically like this:
Initially in my
jsp only one drop down will have values and the other will be disabled. Onchange of first dropdown i do an ajax call which calls my
servlet. The servlet queries the database based on the parameter sent to it
and returns a delimited
string as response.
Again, back in responsetext in ajax, i use string.split method to convert that delimited string to javascript array and populate the options of the second dropdown.
Before that, i remove all the existing options in the second dropdown before populating the fresh data.
This is working fine. But when i
test it by changing the selection in the first dropdown, after say, 4 or 5 selections, the application slows down and is hanging. It says, a script is causing it to run slowly. please stop running the script.
What could be the reason? Here is the javascript function which gets the response from the servlet
Note :grpElement is the name of my second drop down list