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

Closed Issue: MaskedEdit Extender with custom date type mask gives javascript error [13898]

$
0
0
I have defined the maskededit control as such. It validates invalid dates ok on the server side, but everytime a valid date is entered in the textbox, and cursor leaves the textbox, I get a javascript error. The mask differs from the default en-US culture only by specifying a 2 digit year as opposed to a 4 digit year.

<ajaxToolkit:MaskedEditExtender ID="medtDueDate" runat="server"
TargetControlID="txtDueDate" Century="2000"
Mask="99/99/99"
MaskType="Date"
DisplayMoney="None"
AcceptNegative="None"/>

The error I narrowed down to this code in scriptresource.axd file...

Error: Ycur has no properties
Source file: https://cafedevelop/IR/ScriptResource.axd?d=pdVRyRDcv1LicjmdE8JGmCsxdyl9TtuiSAy6fYA221Tua6iQH0LdMal0uLptytjPRmOhOMIlJiUfa0Bd08Nzqclahzv80o1_KZDUngfLfGQ1&t=633259125600000000
Line: 1510

The following is the code snippet where the error is occurring...

var Dcur,Mcur,Ycur;if (autocomp == "")
{
var CurDate = new Date();Dcur = (CurDate.getUTCDate()).toString();if (Dcur.length < 2)
{
Dcur = "0" + Dcur;}
Mcur = (CurDate.getUTCMonth()+1).toString();if (Mcur.length < 2)
{
Mcur = "0" + Mcur;}
if (Y4)
{
Ycur = CurDate.getUTCFullYear().toString();}
else
{
Ycur = Ycur.substring(2);} //This is line 1510 where the error occurs.

The way I read this code, YCur is only set if the "if(Y4)" condition evaluates to true, but my code fails in the else where YCur has not been initialized at all. Seems to me this is a bug, unless someone can explain otherwise. By the way, I am using the latest release of the toolkit (10920).

Thanks,

Mark
Comments: Issues is closed as it is fixed with April 2013 release.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>