Hello,
Glad to be part of this forum! I am developing an html form at work and found two very useful scripts, one is a javascript library to manage showing/hiding form elements, and another which is an javascript calendar.
However when I use them both on the same page the showing/hiding library (usableforms.js) does not work for elements like the checkbox which use onclick property. It does still work for a select.
It seems to me that the calendar script is trapping all onclick events. I have sifted through the source js file, but I am not familar with javascript enough to alter the script so it only traps click events from the calendar.
Usable Forms link (showing/hiding)
site: [url]http://www.quirksmode.org/dom/usableforms.html
js file: [url]http://www.quirksmode.org/dom/usableforms.js
Simple Calendar Widget Link
site: [url]http://www.garrett.nildram.co.uk/calendar/scw.htm
js file: [url]http://www.garrett.nildram.co.uk/calendar/scw.js
Here is the section of the calendar widget .js which i think where the problem is, but I could be wrong. I’ve tried commenting out the bottom four lines (which I think are used to close the calendar popout when you click outside of it), but that didn’t work:
[CODE] if (document.addEventListener)
{scwID(‘scw’ ).addEventListener(‘click’,scwCancel,false);
scwID(‘scwHeadLeft’ ).addEventListener(‘click’,scwStopPropagation,false);
scwID(‘scwMonths’ ).addEventListener(‘click’,scwStopPropagation,false);
scwID(‘scwMonths’ ).addEventListener(‘change’,scwStopPropagation,false);
scwID(‘scwYears’ ).addEventListener(‘click’,scwStopPropagation,false);
scwID(‘scwYears’ ).addEventListener(‘change’,scwStopPropagation,false);
scwID(‘scwHeadRight’).addEventListener(‘click’,scwStopPropagation,false);
}
else {scwID(‘scw’ ).attachEvent(‘onclick’,scwCancel);
scwID(‘scwHeadLeft’ ).attachEvent(‘onclick’,scwStopPropagation);
scwID(‘scwMonths’ ).attachEvent(‘onclick’,scwStopPropagation);
scwID(‘scwMonths’ ).attachEvent(‘onchange’,scwStopPropagation);
scwID(‘scwYears’ ).attachEvent(‘onclick’,scwStopPropagation);
scwID(‘scwYears’ ).attachEvent(‘onchange’,scwStopPropagation);
scwID(‘scwHeadRight’).attachEvent(‘onclick’,scwStopPropagation);
}
// ***************************
// End of Calendar structure
// ***************************
// ****************************************
// Start of document level event definition
// ****************************************
if (document.addEventListener)
{document.addEventListener(‘click’,scwHide, false);}
else {document.attachEvent(‘onclick’,scwHide);}
If anybody has any ideas I would really appreciate it.