Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic datepicker, set max and min value (Read 8332 times)
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
datepicker, set max and min value
Dec 4th, 2014 at 7:33pm
Print Post  
Hi there,

I tried to set the datepicker min/max value based on my radio input client function.

It like when I select a radio input, the javascript is about to set the datepicker min/max date limit.

say I select radio input 1, then
here is the code :

Code (Javascript)
Select All
var today = new Date();

$find("DatePicker1").set_maxDate(today);
                    $find("DatePicker2").set_maxDate(today);

 



I am sure the function is invoked since I run it step by step via breakpoint, but when I open the datepicker calendar to select date, I still can select the date which later than today.

Thank you
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: datepicker, set max and min value
Reply #1 - Dec 7th, 2014 at 6:50am
Print Post  
Hi,

If you set a value which is outside of the range defined by MinDate and MaxDate, the new value is accepted, but the ValidationState of the control is set to Invalid.

To respond to state changes, you should handle the stateChanged and/or valueInvalid client-side event. From there you can either indicate to the user that the input date is out of bounds, or you can change the control's value to a date that falls within the given range.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint