DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37755>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37755

           Summary: [validator]javascript date validation failure
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: major
          Priority: P2
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


if neither datePattern nor datePatternStrict is specified in validation.xml, 
the validation should use the short date pattern of user's locale or default 
locale. The client side validation always fails (javascript error occurs) when 
no date pattern is specified for the field. 

Javascript error in function "validateDate(form)" : 
datePattern has no properties on line :

if ((field.type == 'hidden' ||
                field.type == 'text' ||
                field.type == 'textarea') &&
               (value.length > 0) && (datePattern.length > 0) &&

I suggest that function is modified so it tests whether datePattern is null 
after instruction "datePattern = oDate[x][2]("datePattern");" and if so 
initializes it to a global javascript variable that would be dynamically 
generated with a value based on the locale : ((SimpleDateFormat) 
DateFormat.getDateInstance(DateFormat.SHORT, theUsersLocale)).toPattern

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to