I am implementing geo-location table using SQL Server.
I have added major country, states and cities in database, but I want to allow adding values by selecting ‘Other‘ option in drop down. If I select ‘other‘ in country, then same option should be selected in state and city dropdowns. It should also show additional textboxes for each dropdown.
I am using asp.net 3.5, database is sql server 2008 using linq. Please help!!
I am implementing geo-location table using SQL Server. I have added major country, states
Share
After you fill your dropdowns with values from the database, you should add one more:’Other…’ with the value of ‘other’, it should be placed at the end of the lists.
Also, you should place one hidden textbox for each dropdown:
On the client side, you can use jQuery or javascript to catch when user select this value. There should be three functions: ‘other country’ shows all three textboxes, ‘other state’ shows two and ‘other city’ shows only one:
In the same way, create functions for States and Cities.
After this, at the code behind you can check if selected values are ‘other’, then use value from the textboxes. I hope you get the idea.