Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with validating entries in masked inout box

Hello,

I have several masked input boxes for users to enter numeric data, such

xxx,xxx  xxxx-xx-xxx-xxxx, xx.x

How do I alert the users when they attempt to  leave the control without inputing all the data in the masked input box?

Victor
Avatar of teebon
teebon
Flag of Singapore image

Hi Victor,

Consider using AjaxControlToolkit:

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/MaskedEdit/MaskedEdit.aspx

You may use ValidationExpression in MaskedEditValidator to achieve your intended validation.

You may refer to the following for some common regular expression for validation:

http://msdn.microsoft.com/en-us/library/ff650303.aspx
onblur event of textbox can be used for this validation .

please provide the code which can show us the issue.

Meeran03
Avatar of Victor  Charles

ASKER

Hi,

all I have is the code for the controls, below is a couple of examples of the aspx code:

<td class="style40" bgcolor="#CCCCCC">
                    <cc2:C1MaskedInput ID="C1AccelerationMax" runat="server" Mask="999,999"
                        Width="50px" />
                </td>
<cc3:C1MaskedInput ID="C1NSNA" runat="server" Mask="9999-99-999-9999"
                          style="top: 3px; left: -1px; height: 0.8em; width: 107px" />

V.
This control has a Textchanged property, but I do not see an onblur property.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial