Adding multiple values from a textbox to a label

hello guys

This should be very easy for most of you. I have a web page where I have a ASP text box named "txtdate" below of which I have a html button called "Add Date" next of which there is another textbox named "txtAddDate". I also have a lable named lblDate

What I need is:

1)Textbox "txtDate" should not accept more than integer 3(the maximum value a user can enter should not be more than 3)

2)When the user enters one date in "txtAddDate" and clicks on "Add Date" the date should be populated on lblDate(this is when the user enters integer 1 in txtDate)

3)When then user has entered 2 in txtdate then he should be able to add two dates into lblDate by clicking on Add Date after entering two different dates. Same case in 3 where in he can add three dates.

4) And then I can insert these dates into a table in the datebase.

Can anyone please help me in this regard?

an example with some code would be highly appreciated...

All this is regarding my job and I'm desperately in need of help.

Who is Participating?
1.  Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e AsSystem.EventArgs) Handles TextBox1.TextChanged      
         If TextBox1.Text.Length > 3 Then            
                 msgbox "Cant be more than 3"
        End If
End Sub
2. Private Sub AddDate_Click( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles AddDate.Click
    If txtDate = 1 then
          lblDate = txtAddDate.text
    Elseif txtDate = 2 then
           lblDate = lblDate & " " & txtAddDate.text
    Elseif txtDate = 3 then
           lblDate = lblDate & " " & txtAddDate.text
    End if
End Sub
hardlearnerAuthor Commented:
Hi techHead

I am going to try the same with javascript..making it a client-side validation. Improves lil bit of performance. If I cant get thru that then I'll follow urs. Thank you

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.