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. problem to Show "Sending ..." for OnClientClick in my button.

problem to Show "Sending ..." for OnClientClick in my button.

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutorialquestion
5 Posts 3 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.
  • H Offline
    H Offline
    hdv212
    wrote on last edited by
    #1

    hi i write this JavaScript Code for change Text of my label : Function lbl_Waint() { document.getElementById("lbl_status").setAttribute("Text","Sending ..."); } and in OnClientClick of my button write this code : OnClientClick="lbl_Waint();true" but it doesn't work, how to solve my prblem ? thanks

    G 1 Reply Last reply
    0
    • H hdv212

      hi i write this JavaScript Code for change Text of my label : Function lbl_Waint() { document.getElementById("lbl_status").setAttribute("Text","Sending ..."); } and in OnClientClick of my button write this code : OnClientClick="lbl_Waint();true" but it doesn't work, how to solve my prblem ? thanks

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You are confusing the server control with the html elements that it renders. A label will be rendered as a span tag, and a span tag has no Text attribute. Use the innerHTML property of the element to change it's text.

      --- single minded; short sighted; long gone;

      H 1 Reply Last reply
      0
      • G Guffa

        You are confusing the server control with the html elements that it renders. A label will be rendered as a span tag, and a span tag has no Text attribute. Use the innerHTML property of the element to change it's text.

        --- single minded; short sighted; long gone;

        H Offline
        H Offline
        hdv212
        wrote on last edited by
        #3

        thanks for reply, i change my code by your suggestion as follow : document.getElementById("lbl_status").innerHTML = str; but does't worked again.plz write full example of this problem,thanks

        G 1 Reply Last reply
        0
        • H hdv212

          thanks for reply, i change my code by your suggestion as follow : document.getElementById("lbl_status").innerHTML = str; but does't worked again.plz write full example of this problem,thanks

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Standard question #1: What do you mean by "not working"? Standard question #2: What error message do you get? Full example: document.getElementById('lbl_status').innerHTML = 'Sending...'; Have you verified that the id of the generated element is correct?

          --- single minded; short sighted; long gone;

          R 1 Reply Last reply
          0
          • G Guffa

            Standard question #1: What do you mean by "not working"? Standard question #2: What error message do you get? Full example: document.getElementById('lbl_status').innerHTML = 'Sending...'; Have you verified that the id of the generated element is correct?

            --- single minded; short sighted; long gone;

            R Offline
            R Offline
            RSArockiam
            wrote on last edited by
            #5

            I think, lbl_status is server control. So, Try the following way document.getElementById('<%= lbl_status.ClientID.ToString() %>').innerHTML = 'Sending...';

            Regards R.Arockiapathinathan

            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