Enable/Disable Panels when TextBox value is entered RRS feed

  • Question

  • User-858460272 posted

    Hi guys,

    I've got a website under development which uses 2 panels to dispaly data (mainly textboxes). The 1st panel is enabled but 2nd one is disabled. I want to be able to enable the 2nd panel when a user has completed the details in the 1st panel correctly. I have 3 textboxes in the 1st panel & they all need values entered by the user. Once the correct data has been entered in the 1st panel's textboxes i want the 2nd textbox enabled automatically.

    The nearest thing i could find would be the textchanged property of a textbox. I tried this but it would not go into the code when i typed anything in the textbox. Even still, i would not want to a code each time a characters is changed in the textboxes.

    What is the best way to achive this?



    Thursday, September 11, 2008 8:02 AM

All replies

  • User-1087343799 posted

     textbox textchanged property fires when Enter is clicked inside textbox or textbox looses focus, so it can be the right solution.

    Thursday, September 11, 2008 8:54 AM
  • User2130758966 posted

    First idea

    Use javascript, probably a library like jQuery, to detect the change and enable the panel at the appropriate time. You would have to write your own javascript validation for this though.


    Second idea

    Put the panels on seperate "pages" inside a Wizard control.

    The asp validators will fire between pages and you cant get to the next page until you have filled out the boxes correctly.

    Thursday, September 11, 2008 8:56 AM
  • User-990694832 posted

    Looking at --Once the correct data has been entered in the 1st panel's textboxes --,

    a person could conclude that there is some validation going on.  create a custom validator to validate the text boxes and in the final validation enable the 2nd panel.  

    Hope this helps



    Thursday, September 11, 2008 9:33 AM