![]() |
| ||
| separating line by line from textbox with textmode=multiline 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... can this be done? please somebody help me... |
| ||
| 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) Example code: the aspx page <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> the code behind using System; |
| ||
| Re: separating line by line from textbox with textmode=multiline thanks for your help.. so...i must use listbox ya? hehe..thanks but... this is c#... can u write in vb.net? huhu.... |
| ||
| Re: separating line by line from textbox with textmode=multiline Quote:
for example: StringCollection options = new StringCollection(); //MMMm MMmm baby! Dim options As New StringCollection() 'wordy wordy yuck! |
| ||
| Re: separating line by line from textbox with textmode=multiline hehe....thanks ya hollystyles.. may God bless u... |
| ||
| 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.. can u help me? |
| ||
| Re: separating line by line from textbox with textmode=multiline Oh dear, fussy fussy :cheesy: Ok I add a TextBox for the user to add their free text and an add button that adds there text to the ListBox on postback. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> using System; |
| ||
| Re: separating line by line from textbox with textmode=multiline dear hollystyles... this method works.... thank u... arigatou gozaimas... hope someday i'll be master in programming... :p |
| ||
| Re: separating line by line from textbox with textmode=multiline Ne nadda mi amigo. With bells on !:p |
| All times are GMT -4. The time now is 11:20 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC