We use cfinput where by the type is datefield as a datepicker instead of some external javascript calendars. Faced growing problems using this but managed to overcome most of them except that it still does not overlap the form fields below it.
- Chrome cannot work –> solved by placing the cfform outside the table and add in style=”margin:0px”
- date display wrongly –> solved by putting the date object into the value. Use DateAdd to convert to date object
- onchange not supported on cfinput –> solved using cfajaxproxy bind expression
Eg:
<cfinput name =”fromDate”
id =”fromDate”
type =”datefield”
class =”dateField”
size =”11″
maxlength=”10″
validate=”eurodate”
validateat=”onsubmit”
mask =”dd/mm/yyyy”
value =”#fromDateFormatted#”
readonly>
<cfajaxproxy bind=”javascript:bindChangeDate({fromDate})”>
<cfinput type=”hidden” name=”hidFromDate” id=”hidFromDate”
value=”#DateFormat(fromDateFormatted,’dd/mm/yyyy’)#”>
// create ajax bind to datefield
function bindChangeDate(date) {
var oldDate = document.getElementById(‘hidFromDate’).value;
var newDate = date;
if(oldDate != newDate){
alert(‘changed!’);
}
}
Url: http://www.packtpub.com/article/coldfusion-ajax-programming
Url: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=ajaxdata_11.html
Url: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=ajaxui_1.html#1096321
Hi,
You may have found this solution, but it was the easiest one I found and got to work. You will see plenty to adjust the JS file, include a JS file to override…well, I think this is simple and could be used in DHTML or CSS as well as HTML (untested-assumption only).
Not the “style” attribute on the . z-index your multiple fields in reverse order. I did find that the position:relative is needed for this to work.
Hope it works for you… Rob
Hi Rob,
I do not try the proposed solution but we have stopped using cfcalendar because it does not have month and year selection. Imagine clicking the previous month button all the way till the date of birth, it will be frustrating. I know that there may be a solution to include month and year selection within cfcalendar but we do not want to waste time and replace it with the old calendar picker in javascript that we have.
Is your website fully functional or in progress? Some of the links are not working?
Eileen