Forums

Date fields settings different for multiple date fields

moleculezz 04 May, 2010
Hello,

I am trying to call a certain function for each date field when "onHideComplete". I could not figure out how to do it using the "Date Fields Settings", so now I'm trying to do it using the javascript form code field. I added the following code, but it's not working as it should. It creates a second datepicker button. So how do I add the "onHideComplete" property to the already created Calendar object "myCal_datum" and "myCal_datum_retour"?
example:

var execute1 = function(){
alert('do something');
}

var execute2 = function(){
alert('do something too');
}
var myCal_datum = new Calendar({ datum: 'd/m/Y' }, { classes: ['dashboard'], direction: .5, onHideComplete: execute1 });

var myCal_datum_retour = new Calendar({ datum: 'd/m/Y' }, { classes: ['dashboard'], direction: .5, onHideComplete: execute2 });


I did try something like this but did not work:

myCal_datum.onHideComplete = execute1;
myCal_datum_retour.onHideComplete = execute2;
moleculezz 05 May, 2010
I was able to figure it out finally...


myCal_datum.addEvent('onHideComplete', execute1);
myCal_datum_retour.addEvent('onHideComplete', execute2);
This topic is locked and no more replies can be posted.