separating line by line from textbox with textmode=multiline
Expand Post »
hi..i'm new in using ASP.NET application. Please guide me as i've only about 30% knowledge on developing web application in .NET
ok..my problem is..
i have a textbox..
i wanted user to create multiple option by entering each option per line in the textbox...
in other words..if user want to enter 4 option, 1st option will be at 1st line, 2nd option at 2nd line....and so on..
so..when i create button "Submit"..it will automatically assume that data in the first line will be inserted to first row in table in my database...
Re: separating line by line from textbox with textmode=multiline
Consider using a ListBox web control.
1. You supply the options for the user to choose rather than free type (free text is always a validation headache for you to keep sh** out of your db)
2. ListBox has a multiselect mode (user can use shift or ctrl key to select more than one option if you set the property to true)
3. You can iterate the ListBox as it implements IEnumarable, which has gotta be easier than parsing a fat wedge of text from a textarea (which is what a multiline textbox is rendered as to the client)
Re: separating line by line from textbox with textmode=multiline
Quote ...
can u write in vb.net?
Yes thanks, but personally I find typing VB syntax akin to scraping honey off a teaspoon, whereas typing c# syntax is more like licking it off! IYKWIM.
Re: separating line by line from textbox with textmode=multiline
aiyak..
but what if i want user to enter their choices...
my program is like...
i want to create a survey creator system..
user will enter their question..1 question may have more than 1 answers... i want user to enter their choices..one question per line, then i'm gonna save the option line by line as list of options into my database b4 the system generate the template..
so..right now, my problem is to reaa line by line text in the textbox..and to save the list of options into database..
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.