RadTextBox repaint issue?

4 posts, 0 answers
  1. Josh
    Josh avatar
    4 posts
    Member since:
    Sep 2012

    Posted 23 Jan 2014 Link to this post

    I am starting off with a RadTextBox disabled and when I check a checkbox it enables the RadTextBox however it does not repaint/redraw and still looks disabled.


    How would one go about fixing that?

    I'm using jquery to do the enable/disable
        $('#CheckBox1').change(function () {
            if (this.checked) {
                $('#txtInput').prop('disabled', false);
            } else {
                $('#txtInput').prop('disabled', true);
            }
        });
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Jan 2014 Link to this post

    Hi Josh,

    Please try the following code snippet which works fine at my end.

    JavaScript:
    <script type="text/javascript">
        $('#CheckBox1').change(function () {
            if (this.checked) {
                //enable the textbox
                $('#RadTextBox1')[0].control.enable();
            } else {
                //disable the textbox
                $('#RadTextBox1')[0].control.disable();
            }
        });
     
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Josh
    Josh avatar
    4 posts
    Member since:
    Sep 2012

    Posted 23 Jan 2014 Link to this post

    That works perfect for the RadTextBox Thanks.

    When I applied the same logic to a RadComboBox it threw errors. How would I disable/enable the RadComboBox in the same function?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Jan 2014 Link to this post

    Hi Josh,

    Please have a look into the following JavaScript code which works fine at my end.

    JavaScript:
    <script type="text/javascript">
        $('#CheckBox1').change(function () {
            if (this.checked) {
                $('#RadComboBox1')[0].control.enable();
            } else {
                $('#RadComboBox1')[0].control.disable();
            }
        });
    </script>

    Let me know if you have any concern.
    Thanks,
    Shinu.
Back to Top