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

Using a mask without displaying it

1 Answer 64 Views
Input
This is a migrated thread and some comments may be shown as answers.
Hk
Top achievements
Rank 2
Hk asked on 10 Mar 2009, 02:58 PM
Hi Telerik,
I'm using RadMaskedInput to make an IP textbox. Currently the mask is: <0..255>.<0..255>.<0..255>.<0..255>

and the initial text in the textbox is: 000.000.000.000
I'm saving the text with literals (e.g. 192.168.168.201 and not 192168168201)

I'd like to know if there is a way (static or dynamic), to keep the abilities of the mask (enable only 4 groups of numbers, each number is between 0..255) but without initialiy displaying 000.000.000.000 but only spaces, meaning: "    .     .     .    ", and still saving it with the literals?

Thanks in advance,
Hk

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 11 Mar 2009, 02:12 PM
Hi Hk,

You can set the PromptChar property in order to display spaces instead of zeros:

<telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server"
    Mask="###.###.###.###" PromptChar=" " />

After PostBack, you need to get RadMaskedTextBox1.TextWithLiterals in order to save the textbox value with the literals.

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Input
Asked by
Hk
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Share this question
or