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. Javascript : Textbox Disable

Javascript : Textbox Disable

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
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.
  • S Offline
    S Offline
    ss mmm
    wrote on last edited by
    #1

    Trying to disable a textbox using a Javascript function. The application page does not have the

    element. Will not be able to use, document.form.element None of these work!! document.getElementById('<%=Textbox1.ClientID%>').enabled=false} document.getElementById("physicalAddr1TextBox").enabled=false} document.getclientElementID("physicalAddr1TextBox").enabled= false; Please help

    Thanks

    G 1 Reply Last reply
    0
    • S ss mmm

      Trying to disable a textbox using a Javascript function. The application page does not have the

      element. Will not be able to use, document.form.element None of these work!! document.getElementById('<%=Textbox1.ClientID%>').enabled=false} document.getElementById("physicalAddr1TextBox").enabled=false} document.getclientElementID("physicalAddr1TextBox").enabled= false; Please help

      Thanks

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

      No wonder. An html element doesn't have any enabled property. document.getElementById('<%=Textbox1.ClientID%>').disabled = true;

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

      S 2 Replies Last reply
      0
      • G Guffa

        No wonder. An html element doesn't have any enabled property. document.getElementById('<%=Textbox1.ClientID%>').disabled = true;

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

        S Offline
        S Offline
        ss mmm
        wrote on last edited by
        #3

        Thanks:laugh::wtf:;P

        Thanks

        1 Reply Last reply
        0
        • G Guffa

          No wonder. An html element doesn't have any enabled property. document.getElementById('<%=Textbox1.ClientID%>').disabled = true;

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

          S Offline
          S Offline
          ss mmm
          wrote on last edited by
          #4

          Can you help me with this one? In code behind, there is the borderstyle property. TextBox.BorderStyle = BorderStyle.NotSet; How can I write this in javascript using document.getElementById?

          Thanks

          M 1 Reply Last reply
          0
          • S ss mmm

            Can you help me with this one? In code behind, there is the borderstyle property. TextBox.BorderStyle = BorderStyle.NotSet; How can I write this in javascript using document.getElementById?

            Thanks

            M Offline
            M Offline
            Mack Ait Aoudia
            wrote on last edited by
            #5

            hello, you could change the css class for the textbox: document.getElementById(textboxid).className ='thecssclass'; and write the thecssclass with any styles you want. Hope it helps!

            Just Relax And Keep It Simple.

            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