Hi,
We have an asp text box with a MaskedEditExtender.
This input works fine with fr, us,... culture.
But when we used czech culture the input text value switch the AM/PM czech value.
In czech, the AM/PM correspond to dop./odp.
When we have a value 05:00:00 odp. and we enter in the text box the value become 05:00:00 dop.
I have locate the issue in MaskedEdit.MaskedEditBehavior.debug.js :
loadValue : function(value,logicPosition)
{
var i;
this._createMask();
var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element());
wrapper.set_Value(this._EmptyMask);
if (this._InputDirection == Sys.Extended.UI.MaskedEditInputDirections.LeftToRight)
{
for (i = 0 ; i < parseInt(value.length,10) ; i++)
{
var c = value.substring(i,i+1);
if ( (this._MaskType == Sys.Extended.UI.MaskedEditType.Time || this._MaskType == Sys.Extended.UI.MaskedEditType.DateTime) && this.get_CultureFirstLettersAMPM().toUpperCase().indexOf(c.toUpperCase()) != -1)
{
if (this._AcceptAmPm)
{
this.InsertAMPM(c);
}
}
else if (this._MaskType == Sys.Extended.UI.MaskedEditType.Number && this._AcceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(c) != -1)
{
this.InsertSignal(c);
}
if (this._processKey(logicPosition,c))
{
this._insertContent(c,logicPosition);
logicPosition = this._getNextPosition(logicPosition+1);
}
}
}
The for loop on all text box character value with inserting AMPM on d caracter the on o charater.
That the reason why "05:00:00 odp." becomes "05:00:00 dop."
Our code :
<asp:TextBox ID="BreakdownStartTime" runat="server" CssClass="editableTime" tabindex="3"
meta:resourcekey="BreakdownStartTime" />
<ajaxToolkit:MaskedEditExtender ID="BreakdownStartTime_MaskedEditExtender"
runat="server" Century="2000" CultureAMPMPlaceholder="dop;odp"
CultureCurrencySymbolPlaceholder="" CultureDateFormat=""
CultureDatePlaceholder="" CultureDecimalPlaceholder=""
CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"
Mask="99:99:99" MaskType="Time" AcceptAMPM="true" TargetControlID="BreakdownStartTime">
</ajaxToolkit:MaskedEditExtender>
<ajaxToolkit:MaskedEditValidator ID="BST_Validator" runat="server"
ControlToValidate="BreakdownStartTime"
ControlExtender="BreakdownStartTime_MaskedEditExtender"
EmptyValueMessage="Time is required"
InvalidValueMessage="Time is invalid"
IsValidEmpty="False"
TooltipMessage="Input a time"
SetFocusOnError="True"
ValidationGroup="ResourceBreakdownGrp" ErrorMessage="BST_Validator"
meta:resourcekey="StartTimeValidator"></ajaxToolkit:MaskedEditValidator>
We have an asp text box with a MaskedEditExtender.
This input works fine with fr, us,... culture.
But when we used czech culture the input text value switch the AM/PM czech value.
In czech, the AM/PM correspond to dop./odp.
When we have a value 05:00:00 odp. and we enter in the text box the value become 05:00:00 dop.
I have locate the issue in MaskedEdit.MaskedEditBehavior.debug.js :
loadValue : function(value,logicPosition)
{
var i;
this._createMask();
var wrapper = Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element());
wrapper.set_Value(this._EmptyMask);
if (this._InputDirection == Sys.Extended.UI.MaskedEditInputDirections.LeftToRight)
{
for (i = 0 ; i < parseInt(value.length,10) ; i++)
{
var c = value.substring(i,i+1);
if ( (this._MaskType == Sys.Extended.UI.MaskedEditType.Time || this._MaskType == Sys.Extended.UI.MaskedEditType.DateTime) && this.get_CultureFirstLettersAMPM().toUpperCase().indexOf(c.toUpperCase()) != -1)
{
if (this._AcceptAmPm)
{
this.InsertAMPM(c);
}
}
else if (this._MaskType == Sys.Extended.UI.MaskedEditType.Number && this._AcceptNegative != Sys.Extended.UI.MaskedEditShowSymbol.None && "+-".indexOf(c) != -1)
{
this.InsertSignal(c);
}
if (this._processKey(logicPosition,c))
{
this._insertContent(c,logicPosition);
logicPosition = this._getNextPosition(logicPosition+1);
}
}
}
The for loop on all text box character value with inserting AMPM on d caracter the on o charater.
That the reason why "05:00:00 odp." becomes "05:00:00 dop."
Our code :
<asp:TextBox ID="BreakdownStartTime" runat="server" CssClass="editableTime" tabindex="3"
meta:resourcekey="BreakdownStartTime" />
<ajaxToolkit:MaskedEditExtender ID="BreakdownStartTime_MaskedEditExtender"
runat="server" Century="2000" CultureAMPMPlaceholder="dop;odp"
CultureCurrencySymbolPlaceholder="" CultureDateFormat=""
CultureDatePlaceholder="" CultureDecimalPlaceholder=""
CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"
Mask="99:99:99" MaskType="Time" AcceptAMPM="true" TargetControlID="BreakdownStartTime">
</ajaxToolkit:MaskedEditExtender>
<ajaxToolkit:MaskedEditValidator ID="BST_Validator" runat="server"
ControlToValidate="BreakdownStartTime"
ControlExtender="BreakdownStartTime_MaskedEditExtender"
EmptyValueMessage="Time is required"
InvalidValueMessage="Time is invalid"
IsValidEmpty="False"
TooltipMessage="Input a time"
SetFocusOnError="True"
ValidationGroup="ResourceBreakdownGrp" ErrorMessage="BST_Validator"
meta:resourcekey="StartTimeValidator"></ajaxToolkit:MaskedEditValidator>