asp.net rangevalidator for calendar extender entries gives problems in safari

Posted by Robin Baralla on Stack Overflow See other posts from Stack Overflow or by Robin Baralla
Published on 2010-03-24T13:30:37Z Indexed on 2010/03/24 13:33 UTC
Read the original article Hit count: 474

Filed under:
|
|

Hi there,

I have the following scenario:

arrival and departure dates have to be selected on a form, through 2 textboxes with a calendar extender each.

I validate the entries to check that no date before today is selected and to check that the departure is after the arrival. I used a rangevalidator and a comparevalidator.

In IE, Firefox and Opera it is working fine, in Safari (on windows) however both the validators go off even on entries that should be accepted.

It makes me suspect that the date format dd/MM/yyyy causes trouble for Safari.

(the dd/MMMM/yyyy also gave the same troubles in the other browsers, probably due to the dependency on UIculture)

The code is:

 

The range validator gets its values in code behind on Page_load

RangeValidator1.MinimumValue = DateTime.Now.AddDays(1).ToShortDateString(); RangeValidator1.MaximumValue = DateTime.Now.AddMonths(12).ToShortDateString();

Does anybody have any suggestions on how to solve this problem with safari?

best regards, Robin

© Stack Overflow or respective owner

Related posts about calendar

Related posts about validation