re: masked edit text box

Thread ID:

Created:

Updated:

Platform:

Replies:

50850 Oct 20,2006 09:42 AM Oct 25,2006 04:37 AM ASP.NET (Classic) 3
loading
Tags: Tools
Administrator [Syncfusion]
Asked on October 20, 2006 09:42 AM
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?
Administrator [Syncfusion]
Replied on October 20, 2006 05:57 PM
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
Administrator [Syncfusion]
Replied on October 24, 2006 07:46 AM
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
Administrator [Syncfusion]
Replied on October 25, 2006 04:37 AM
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