We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

re: masked edit text box

I have a masked edit text box with a mask of ###-###-####. I want to make this field required, what do I put in the initial value of the required field validator to know that the field has not been filled in?

3 Replies

AD Administrator Syncfusion Team October 20, 2006 09:57 PM UTC

Hi Melissa,

The InitialValue should be exactly what you see there " - - " (replacing # with spaces). The RequiredFiedlsValidator ignores leading and trailing spaces, so you can ignore them too.

-Praveen


ME Melissa October 24, 2006 11:46 AM UTC

I had tried that and it didn't work. Here is the code that I have.

< s s w:MaskedEditTextBox ID="PhoneTextBox" Mask="###-###-####" Value='<%# Bind("Phone") %>' runat="server" Width="80px" />

< a s p:RequiredFieldValidator ID="RequiredFieldValidator8" InitialValue=" - - " runat="server" ErrorMessage="Phone is Required" ControlToValidate="PhoneTextBox">*

I have also tried an initial value of "- -", " - - ", and many other variations to no avail.

>Hi Melissa,

The InitialValue should be exactly what you see there " - - " (replacing # with spaces). The RequiredFiedlsValidator ignores leading and trailing spaces, so you can ignore them too.

-Praveen


AD Administrator Syncfusion Team October 25, 2006 08:37 AM UTC

Hi Melissa,


The RequiredFiedlsValidator cannot ignore the space between the literals.

I have attached a sample as per your requirement.



MaskedEditTextWithValidator.zip


Please let me know if you have further queries.


Regards,

Suresh sekaran

Loader.
Live Chat Icon For mobile
Up arrow icon