jquery datepicker event search questions

cilaas

New Member
I am using the jquery event search datepicker in my code which is present here. I am new to jquery and I am using the exact same code. The default date is set to one week ahead of the current date.[*]how do i make the default date to the current day? (simple question, but what is the correct format to do so?).[*]since i am using 2 fields from and to, i then want the default date to be changed according to the value selected in from field. suppose i select 20th june 2009, i want the TO field to show up from 21st June 2009 and not the current date. Can this be even done (too good that jquery automatically disables all the dates that fall before the FROM field).[*]i tried to change the dateformat with this code, \[code\]dateformat: "yy-mm-dd",\[/code\] but it does not change.. shows the default way of mm/dd/yyyy.[*]can i disable the from and two fields, i do not want anyone trying to manually change those values.Code:\[code\]$(function() { var dates = $( "#from,#to" ).datepicker({ defaultDate: "null",dateFormat: "yy-mm-dd", changeMonth: true,disabled:true, numberOfMonths: 3, onSelect: function( selectedDate ) { var option = this.id == "from" ? "minDate" : "maxDate", instance = $( this ).data( "datepicker" ); date = $.datepicker.parseDate( instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings ); dates.not( this ).datepicker( "option", option, date ); } });});\[/code\]
 
Back
Top