CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Datepicker can mirror selected dates into other fields

Print topic Send  topic

Author Message
eratech


Posts: 510
Posted: 03/03/2014, 11:47 PM

Building an Event tracking system for a client - conferences, training, classes etc.

Client requested that when the 'Event Start' date is selected using the inline datepicker, that the 'Event End' date default to the start date, so that they aren't clicking through months of future dates to set the fields.

After considering how to override the CCS datepicker options, I found that you can pass the normal jquery datepicker through with the CCS options.

The example below has the normal CCS options ('dateFormat','isWeekend') and I edited it with the additional jquery-ui option 'altField' which if set will put the selected value into this field as well, and for fun, the 'minDate' option so you cannot start things more than a couple of days ago.

//Feature Parameters @1-FBACC53D  
    params["eventsdate_startInlineDatePicker1"] = {   
        dateFormat: "d/MM/yyyy",  
        isWeekend: true  
        , altField: "#eventsdate_end"  
	, minDate: -2  
    };  
//End Feature Parameters  
  
/** this is where CCS binds the datepicker and passes in the params from above **/  
//Feature Init @1-F75AE43A  
    features["eventsdate_startInlineDatePicker1"].ccsBind(function() {  
        this.ccsDateTimePicker(params["eventsdate_startInlineDatePicker1"]);  
    });  
//End Feature Init

And if you need to mirror the date into 2 other fields instead of one? just list them, comma delimited, in the 'altField':

        , altField: "#eventsdate_end,#eventsdate_bookings_close"

As the built-in CCS datepicker is a jquery plug-in, so you can probably use just about all the normal jquery-ui options if you need to.

Hope this helps someone else.

Cheers

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.