Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax toolkit - Masked Edit Extender
    text
    copied!<p>I am trying to use a masked edit extender for a text box that is to display time zone offset, in the form of 05:00 or -05:00, for example. The following is what I used and it initially displays the mask and allows me to enter either of the above. But when I leave the textbox, it removed the colon and I get invalid format error. What am I missing here? (I changed the MaskType from Number to None hoping it would not drop : but it does).</p> <pre><code>&lt;asp:TextBox runat="server" ID="tbTZOffset" CssClass="NormalSmall" Text="" /&gt; &lt;ajaxToolkit:MaskedEditExtender runat="server" ID="meeTZO" TargetControlID="tbTZOffset" Mask="99:99" MessageValidatorTip="false" MaskType="None" InputDirection="LeftToRight" AcceptNegative="Left" ErrorTooltipEnabled="True"/&gt; &lt;ajaxToolkit:MaskedEditValidator runat="server" ID="mevTZO" ControlExtender="mevTZO" ControlToValidate="tbTZOffset" IsValidEmpty="False" EmptyValueMessage="Time Zone Offset is required" InvalidValueMessage="Time Zone Offset is invalid (must be in [-]hh:mm format)" EmptyValueBlurredText="*" Display="none" ValidationExpression="\b[-]?\d{2}:\d{2}\b" TooltipMessage="Time Zone Offset in [-]hh:mm format" ValidationGroup="vgConfig"/&gt; </code></pre> <p><strong>Added info:</strong></p> <p>I downloaded the newest version of Ajax Control Toolkit for .Net 3.5 (July 2013 version) ; apparently there was a bug in previous versions.</p> <p>I can set MaskType="Number", Mask="NNNNNN" and Filtered="-:", enough characters to allow for 4 digits, negative sign and colon. This seems to allow me to enter both 05:00 and -05:00 but if I enter 05:00, it leaves one space at the end to be filled (i.e. keeps showing the last undercsore like 00:05_ ). It also allows me to enter 05:008.</p> <p>If I change the mask type back to "None", I lose the ability to enter negative numbers again.</p> <p>I have run out of ideas and am ready to just forget about this control. I am not sure if these developers do any kind of testing before releasing their "product".</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload