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

No Textmode property for RadNumericTextBox

1 Answer 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SUBBU
Top achievements
Rank 1
SUBBU asked on 11 Mar 2013, 05:29 AM
Hi,
I need to mask(with bullets) the numbers entered.  But there is no textmode property for RadNumbericTextBox.  I also tried using RadMaskedTextBox, but PromptChar property was not working when textmode is set to Password.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Mar 2013, 07:30 AM
Hello,

The RadNumericTextBox does not support the TextMode property. Similarly the PromptChar property of the RadMaskedTextBox does not work if you are setting the TextMode as Password.

Please have a look into the following code I tried to achieve a similar scenario using the ASP TextBox and JavaScript. The user is allowed to enter only numbers in the textbox and on entering other invalid characters the textbox border color changes to red.

ASPX:
<asp:TextBox ID="textBox" runat="server" MaxLength="5" TextMode="Password"
         onKeyPress="return checkInput(event);" onKeyDown="return checkInput(event);">
</asp:TextBox>

JavaScript:
<script type="text/javascript">
    function checkInput(event) {
        var inp = String.fromCharCode(event.keyCode);
        if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode == 8)) {
            document.getElementById("<%= textBox.ClientID %>").style.border = "1px solid #050409";
            return true;
        }
        else {
            document.getElementById("<%= textBox.ClientID %>").style.border = "1px solid #FF2424";
            return false;
        }
    }
</script>

Thanks,
Princy.
Tags
General Discussions
Asked by
SUBBU
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or