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. how invisible text field show on click of check box without page post back:?

how invisible text field show on click of check box without page post back:?

Scheduled Pinned Locked Moved C#
helpquestion
4 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.
  • 2 Offline
    2 Offline
    2208
    wrote on last edited by
    #1

    i have a text box which has set visible false i want as when as i click on check box then that text field should be enable without post-back (or reload page) how is that possible please help me..

    V 1 Reply Last reply
    0
    • 2 2208

      i have a text box which has set visible false i want as when as i click on check box then that text field should be enable without post-back (or reload page) how is that possible please help me..

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

      look into clients side script like javascript or vbscript.

      V.

      2 1 Reply Last reply
      0
      • V V 0

        look into clients side script like javascript or vbscript.

        V.

        2 Offline
        2 Offline
        2208
        wrote on last edited by
        #3

        ok if i am using update panel and set check box auto post back true still check box is not working how it will work?? asp code <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <td align="left" colspan="4"><asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" oncheckedchanged="CheckBox1_CheckedChanged1" /> <br /> <asp:TextBox ID="TextBox1" runat="server" visible ="false"></asp:TextBox> <br /> </ContentTemplate> </asp:UpdatePanel> server side protected void CheckBox1_CheckedChanged1(object sender, EventArgs e) { if (CheckBox1.Checked==true) { TextBox1.Visible = true; } if (CheckBox1.Checked==false) { TextBox1.Visible = false; } } }

        V 1 Reply Last reply
        0
        • 2 2208

          ok if i am using update panel and set check box auto post back true still check box is not working how it will work?? asp code <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <td align="left" colspan="4"><asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" oncheckedchanged="CheckBox1_CheckedChanged1" /> <br /> <asp:TextBox ID="TextBox1" runat="server" visible ="false"></asp:TextBox> <br /> </ContentTemplate> </asp:UpdatePanel> server side protected void CheckBox1_CheckedChanged1(object sender, EventArgs e) { if (CheckBox1.Checked==true) { TextBox1.Visible = true; } if (CheckBox1.Checked==false) { TextBox1.Visible = false; } } }

          V Offline
          V Offline
          V 0
          wrote on last edited by
          #4

          As I said, use client side script. set AutoPostBack to false and attach a clientside handler for the checkbox. In fact, if you don't need to run on the server, entirely remove the server checkbox (runat server) and add an html checkbox. Help on HTML[^] Help with javascript[^]

          V.

          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