how to get value in the textbox
-
Hia to all, Here i have a problem that,I am using 3 txtboxes and,in these 3, 1 textbox is readonly(getting value from ddlist),and 1 textbox is editable.And now my requirement is, i have to get the values from txt1 and txt2 into txt3.That i have to get only on when txt3_gotfocus.Means when i click for editing in the txt3 ,it shd give the values of txt1 and tx2.(assume both numeric and charcters in txt1 and txt2.) Can anyone give me some idea I know javascript when both txt's are editable.but how to write one is editable and one is readonly. Thanks in advance.
kissy
-
Hia to all, Here i have a problem that,I am using 3 txtboxes and,in these 3, 1 textbox is readonly(getting value from ddlist),and 1 textbox is editable.And now my requirement is, i have to get the values from txt1 and txt2 into txt3.That i have to get only on when txt3_gotfocus.Means when i click for editing in the txt3 ,it shd give the values of txt1 and tx2.(assume both numeric and charcters in txt1 and txt2.) Can anyone give me some idea I know javascript when both txt's are editable.but how to write one is editable and one is readonly. Thanks in advance.
kissy
Hi, AFAIK, there is no OnFocus event in the ASP.NET textbox. If txt2 is the editable one, and you want to have txt3 updated when txt2 is changed, you could do:
Protected Sub txt2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt2.TextChanged
If Txt1 <> "" And Txt2 <> "" Then
Txt3.Text = txt1.Text & txt2.Text
Else
'Error handling code
End If
End Sub -
Hi, AFAIK, there is no OnFocus event in the ASP.NET textbox. If txt2 is the editable one, and you want to have txt3 updated when txt2 is changed, you could do:
Protected Sub txt2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt2.TextChanged
If Txt1 <> "" And Txt2 <> "" Then
Txt3.Text = txt1.Text & txt2.Text
Else
'Error handling code
End If
End Sub