Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to get value in the textbox

how to get value in the textbox

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kissy16
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • K Kissy16

      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

      L Offline
      L Offline
      lucjon
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • L lucjon

        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

        K Offline
        K Offline
        Kissy16
        wrote on last edited by
        #3

        hai lucjon, THanks for ur response.But it is giving any value in txt3. if i try edit,it shd give the txt1 & txt2 values in txt3. Give me some othet idea. plz i have tried as u told,but not working.

        kissy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups