- Welcome, Guest. Please Login or Register
MindFusion  
  Version 2 of our Xamarin Calendar component adds Resource view and support for Universal Windows Platform. Now beta testing spreadsheet component for Java Swing.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
datepicker, set max and min value
Read 1517 times

Xylon   Offline
Junior Member
**
Posts: 96
I Love MindFusion!


   
     
 
datepicker, set max and min value
Dec 4th, 2014 at 7:33pm
 
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):
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
 
 
 
IP Logged    
 
     

Lyubo   Offline
Junior Member
**
Posts: 91
Gender: male
MindFusion team


   
     
 
Re: datepicker, set max and min value
Reply #1 - Dec 7th, 2014 at 6:50am
 
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
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print