Trying to fire an onchange event for a combobox calendar
Here's some nifty script found on the forums. It shows a nice calendar and updates the combo control with the date value EXCEPT when the obj.onControlTextChanged() function is called. The alert value shows the correct date, but the value is not being sent to the server. Removing this function and this works properly. I'm trying to fire an event when the user changes the date.
var d007001 = new AW.UI.Combo;
d007001.setId("d007001");
d007001.setName("d007001");
d007001.setStyle("top","55px");
d007001.setStyle("left","578px");
d007001.setControlText("");
d007001.getContent('box/text').setAttribute('autocomplete', 'off');
d007001.setPopupTemplate(function(){
var self=this;
var onSelect = function(calendar, date){if(calendar.dateClicked){self.setControlText(date);calendar.callCloseHandler();}}
var onClose = function(calendar){calendar.hide();calendar.destroy();}
var disallowDate=function(date){if(date.getFullYear()==2006&&date.getMonth()==11&&date.getDate()==25){return true;} return false;};
var SPECIAL_DATES={2006:{0:[1],6:[4],10:[11,18],11:[25,30,31]},2007:{0:[1],5:[26,29],6:[4],10:[11,18],11:[25,30],},2008:{0:[1],6:[4],11:[25],}};
var dateIsSpecial = function(year, month, day){var m = SPECIAL_DATES[year];if (!m) return false;var d = m[month];if (!d) return false;for (var i in d) if (d[i] == day) return true;return false;}
function dateStatusHandler(date, y, m, d){if (dateIsSpecial(y, m, d)) return "special";else return false;}
var d007001Popup = new Calendar(0,"", onSelect , onClose);
d007001Popup.weekNumbers = false;
d007001Popup.showsTime = false;
d007001Popup.setDateFormat("%m/%d/%Y");
d007001Popup.setDisabledHandler(disallowDate);
d007001Popup.setDateStatusHandler(dateStatusHandler);
d007001Popup.create();
d007001Popup.showAtElement(this.element(),"Bc");
return new AW.HTML.DIV;
});
d007001.onControlTextChanged = function(value) {
alert(value); //shows good here!!!!!
document.U_SCHED.setAttribute('action','https://www.qmsystems.net/qmrox.qsp&app=penta&account=M30000&form=U_SCHED&command=refresh');document.U_SCHED.submit();
}
input data d007001 is empty!
var d007001 = new AW.UI.Combo;
d007001.setId("d007001");
d007001.setName("d007001");
d007001.setStyle("top","55px");
d007001.setStyle("left","578px");
d007001.setControlText("");
d007001.getContent('box/text').setAttribute('autocomplete', 'off');
d007001.setPopupTemplate(function(){
var self=this;
var onSelect = function(calendar, date){if(calendar.dateClicked){self.setControlText(date);calendar.callCloseHandler();}}
var onClose = function(calendar){calendar.hide();calendar.destroy();}
var disallowDate=function(date){if(date.getFullYear()==2006&&date.getMonth()==11&&date.getDate()==25){return true;} return false;};
var SPECIAL_DATES={2006:{0:[1],6:[4],10:[11,18],11:[25,30,31]},2007:{0:[1],5:[26,29],6:[4],10:[11,18],11:[25,30],},2008:{0:[1],6:[4],11:[25],}};
var dateIsSpecial = function(year, month, day){var m = SPECIAL_DATES[year];if (!m) return false;var d = m[month];if (!d) return false;for (var i in d) if (d[i] == day) return true;return false;}
function dateStatusHandler(date, y, m, d){if (dateIsSpecial(y, m, d)) return "special";else return false;}
var d007001Popup = new Calendar(0,"", onSelect , onClose);
d007001Popup.weekNumbers = false;
d007001Popup.showsTime = false;
d007001Popup.setDateFormat("%m/%d/%Y");
d007001Popup.setDisabledHandler(disallowDate);
d007001Popup.setDateStatusHandler(dateStatusHandler);
d007001Popup.create();
d007001Popup.showAtElement(this.element(),"Bc");
return new AW.HTML.DIV;
});
d007001.onControlTextChanged = function(value) {
alert(value); //shows good here!!!!!
document.U_SCHED.setAttribute('action','https://www.qmsystems.net/qmrox.qsp&app=penta&account=M30000&form=U_SCHED&command=refresh');document.U_SCHED.submit();
}
input data d007001 is empty!
Myshka
July 9,