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. Making controls visible using javascript

Making controls visible using javascript

Scheduled Pinned Locked Moved Web Development
javascript
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.
  • N Offline
    N Offline
    nainakarri
    wrote on last edited by
    #1

    Hi I have a 2 radio buttons (not radio button list) and 1 label and 1 textbox in the page. On pageload, i made label visible and textbox invisible. when clicking the other radio button, on selected_index change i made the textbox visible and label invisible. But i want the same using javascript as i dont the postback to happen. Could somebody provide me the code for this. Thanks in advance Naina :)

    V 1 Reply Last reply
    0
    • N nainakarri

      Hi I have a 2 radio buttons (not radio button list) and 1 label and 1 textbox in the page. On pageload, i made label visible and textbox invisible. when clicking the other radio button, on selected_index change i made the textbox visible and label invisible. But i want the same using javascript as i dont the postback to happen. Could somebody provide me the code for this. Thanks in advance Naina :)

      V Offline
      V Offline
      vaghelabhavesh
      wrote on last edited by
      #2

      function showControl(id)
      {
      var ctrl = document.getElementById(id);
      ctrl.style.visibility = "visible";
      }

      function hideControl(id)
      {
      var ctrl = document.getElementById(id);
      ctrl.style.visibility = "hidden";
      }

      See this[^] for more help.

      Be careful, there is no Undo Button(Ctrl+Z) in life.

      M 1 Reply Last reply
      0
      • V vaghelabhavesh

        function showControl(id)
        {
        var ctrl = document.getElementById(id);
        ctrl.style.visibility = "visible";
        }

        function hideControl(id)
        {
        var ctrl = document.getElementById(id);
        ctrl.style.visibility = "hidden";
        }

        See this[^] for more help.

        Be careful, there is no Undo Button(Ctrl+Z) in life.

        M Offline
        M Offline
        megivimal
        wrote on last edited by
        #3

        hi,, But document.getElementbyId(id) -->> returns the null value. how it will work.. Plz help me.....

        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