I’m populating a dropdownlist in c# asp.net-MVC from a SQL table using Linq2Sql. I’d like for the user to be able to enter something that isn’t in the list into the drop down and have it add to the table. Is this possible?
I’m populating a dropdownlist in c# asp.net-MVC from a SQL table using Linq2Sql. I’d
Share
Sounds like you need to add a radio button labeled “Other”. When the user clicks the radio button a text box would appear that allows the user to input a new value that you can save to your DB and display in the drop down.
EDIT:
Quick snippet to enable the control using JavaScript:
You can use a check box instead of a radio button so that the enabled property can be toggled.
To completely hide the text box then you will have to look into jQuery/Ajax.