Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Edited Issue: MaskedEditExtender type Date fails with "hu-HU" culture [27764]

$
0
0
The MaskedEditExtender fails when the CultureName="Date" and MaskType="hu-HU" settings are used.

__Behavior__: The date value is cleared from the underlying textbox,
Also the underlying textbox posts back automatically when the switch month/year functionality is used.

__Failing code__:
```
, ConvFmtDate : function(input,loadFirst)
{
...,
m_mask = m_mask.split("/");
if (parseInt(m_arrDate.length,10) != 3)
{
return "";
}
...
```
__Reason__: The ShortDate format for the Hungarian culture is yyyy.MM.dd. (notice the trailing dot), hance the Mask value of the MaskedEditExtender will be "9999/99/99/".
With these settings the __ConvFmtDate__ function fails when checking the splitted input value (ex.: 2015.02.02.) to have exactly __3__ parts. In this case the __m_arrDate__ array has __4__ elements, the last element being an empty string.

__Proposed fix__: The ConvFmtDate function should remove the trailing empty part and only check the length of array afterwards.

__Markup example__:
```
<asp:TextBox ID="txtDate" runat="server" Width="75px" AutoPostBack="true" OnTextChanged="txtDate_TextChanged" /
<cc1:CalendarExtender runat="server" ID="CalendarExtender1" Enabled="true" TargetControlID="txtDate" />
<cc1:MaskedEditExtender ID="txtDate_MaskedEditExtender" runat="server" ClearMaskOnLostFocus="False" TargetControlID="txtDate" MaskType="Date" CultureName="hu-HU" Mask="9999/99/99/" DisplayMoney="Left" AcceptNegative="Left" ClearTextOnInvalid="false" Enabled="True" />
```

Viewing all articles
Browse latest Browse all 4356

Trending Articles