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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Javascript : Disable buttone

Javascript : Disable buttone

Scheduled Pinned Locked Moved C#
csharpjavascriptasp-nettoolshelp
3 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.
  • R Offline
    R Offline
    Ramkithepower
    wrote on last edited by
    #1

    Hi, I am building a ASP.NET page using c#. I need a code to add a javascript function to disable a button on a text change event. The below is the code i wrote The script code in tags: function SetButtonStatus() { document.getElementById("Button2").disabled = true; } other codes here this is the textbox tag: It doesn't seem to work. Please help me on this one. I tried this in ASP.Net forums there were no replies

    T C 2 Replies Last reply
    0
    • R Ramkithepower

      Hi, I am building a ASP.NET page using c#. I need a code to add a javascript function to disable a button on a text change event. The below is the code i wrote The script code in tags: function SetButtonStatus() { document.getElementById("Button2").disabled = true; } other codes here this is the textbox tag: It doesn't seem to work. Please help me on this one. I tried this in ASP.Net forums there were no replies

      T Offline
      T Offline
      tech603
      wrote on last edited by
      #2

      I would suggest just doing it in your code behind. This is a bit of c# code that works. On the aspx page : in the code behind protected void TextBox1_TextChanged(object sender, EventArgs e) { Button1.Enabled = false; } Now take note to the field AutoPostBack="true" this will update the button automatically after you click out of the textbox itself, which will cause the page to update. If you want to manually update the page you can just remove that line. Hope that helps

      Matthew Vass QA Analyst mvass@hostmysite.com HostMySite.com

      1 Reply Last reply
      0
      • R Ramkithepower

        Hi, I am building a ASP.NET page using c#. I need a code to add a javascript function to disable a button on a text change event. The below is the code i wrote The script code in tags: function SetButtonStatus() { document.getElementById("Button2").disabled = true; } other codes here this is the textbox tag: It doesn't seem to work. Please help me on this one. I tried this in ASP.Net forums there were no replies

        C Offline
        C Offline
        Cracked Down
        wrote on last edited by
        #3

        This is not a ASP.Net forum Put your queries related to ASP.Net in ASP.Net Forum

        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