This is a migrated thread and some comments may be shown as answers.

How to enable/disable RadMaskedTextBox clientside?

4 Answers 145 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Gauri
Top achievements
Rank 1
Gauri asked on 02 May 2012, 04:00 PM
I need to enable/disable RadMaskedTextBox clientside?

I will appreciate any help.

Thanks.
Gauri

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 May 2012, 05:01 AM
Hello Gauri,

Try the following javascript.
JS:
function OnClientClick()
{  
 var txt1 = $find("<%=RadMaskedTextBox1.ClientID %>");
 txt1.set_enabled(false);
}

Thanks,
Shinu.
0
Gauri
Top achievements
Rank 1
answered on 03 May 2012, 02:43 PM
Thanks Shinu,

But I had already tried this and that didn't do the trick. :(
0
Accepted
Shinu
Top achievements
Rank 2
answered on 03 May 2012, 03:35 PM
Hi Gauri,

Take a look into the following code snippet.

JS:
<script type="text/javascript">
    function OnClientClick()
    {
        var txt1 = $find("<%=RadMaskedTextBox1.ClientID %>");
        if (some condition)
            txt1.enable();
        else
            txt1.disable();
    }
</script>

Thanks,
Shinu.
0
Gauri
Top achievements
Rank 1
answered on 03 May 2012, 06:31 PM
Thanks a lot for the help.

I tried each one separately before and didn't work.

Using them together seems to do the trick.
Tags
Ajax
Asked by
Gauri
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Gauri
Top achievements
Rank 1
Share this question
or