Updating drop-downlist boxes corresponding to values selected in the other drop-down list
-
Hi....I have two drop-down List boxes.How to update one drop-down list box based on values of other drop-down list.. E.g: Drop-down list 1 contains cars like Toyota,Hyundai etc... If Toyota is Selected (drop-down list 2 it must be updated with models of Toyota) else Hyundai is selected (drop-down list 2 must be updated with models of Hyundai) All these data must be taken from SQL server I am able to display the drop-down list 1 but i am not sure how to display only corresponding models of the selected Make(drop-down list1)
-
Hi....I have two drop-down List boxes.How to update one drop-down list box based on values of other drop-down list.. E.g: Drop-down list 1 contains cars like Toyota,Hyundai etc... If Toyota is Selected (drop-down list 2 it must be updated with models of Toyota) else Hyundai is selected (drop-down list 2 must be updated with models of Hyundai) All these data must be taken from SQL server I am able to display the drop-down list 1 but i am not sure how to display only corresponding models of the selected Make(drop-down list1)
Why is this asked so often when it's so trivial ? 1 - handle the changed event of the first list 2 - in the event, read the value, and use it to populate the second list
Christian Graus Driven to the arms of OSX by Vista.
-
Why is this asked so often when it's so trivial ? 1 - handle the changed event of the first list 2 - in the event, read the value, and use it to populate the second list
Christian Graus Driven to the arms of OSX by Vista.
I asked this because i am unable to pass the values.....can u provide me with an example.... I am not sure of how to pass the Make value to database inorder to get the Model..... Give me one example
-
I asked this because i am unable to pass the values.....can u provide me with an example.... I am not sure of how to pass the Make value to database inorder to get the Model..... Give me one example
Well, typically, there is an id stored as a value for the first list, so you end up with something like select * from model where makeID = @makeId as a stored proc which you call using the id from the selected column.
Christian Graus Driven to the arms of OSX by Vista.
-
Well, typically, there is an id stored as a value for the first list, so you end up with something like select * from model where makeID = @makeId as a stored proc which you call using the id from the selected column.
Christian Graus Driven to the arms of OSX by Vista.
This can also be done with AJAX. You have the user-facing page, an AJAX script, and a dynamic page. The user's selection passes a value over an XmlHttp request to a dynamic page, the output is returned via XmlHttp, and the contents of the user-facing page are changed via Javascript. Check out this example which has samples of all three parts- http://w3schools.com/ajax/ajax_database.asp[^] Good luck! Ranjit Viswakumar Professional Services Specialist HostMySite.com[^]
-
This can also be done with AJAX. You have the user-facing page, an AJAX script, and a dynamic page. The user's selection passes a value over an XmlHttp request to a dynamic page, the output is returned via XmlHttp, and the contents of the user-facing page are changed via Javascript. Check out this example which has samples of all three parts- http://w3schools.com/ajax/ajax_database.asp[^] Good luck! Ranjit Viswakumar Professional Services Specialist HostMySite.com[^]
Sure - it's almost the canonical AJAX example. I was just trying not to confuse the guy tho.
Christian Graus Driven to the arms of OSX by Vista.