Board Logo

Three unique date fields on my form
tagdrj - 11/20/2008 at 03:42 PM

I have three date fields on a form. But I get 'Object doesn't support this method' error when adding the third field. What am I missing?

<input type="text" name="StartDate" onFocus="this.blur();calendar1.popup()">
<input type="text" name="EndDate" onFocus="this.blur();calendar2.popup()">
<input type="text" name="FollowUpDate" onFocus="this.blur();calendar3.popup()">

var calendar1 = new calendar2(document.forms['ActivityForm'].elements['StartDate']);
var calendar2 = new calendar2(document.forms['ActivityForm'].elements['EndDate']);
var calendar3 = new calendar2(document.forms['ActivityForm'].elements['FollowUpDate']);


tagdrj - 11/20/2008 at 04:21 PM

I don't know why the original code throws an error, but I figured out a solution. It works now.

<input type="text" name="StartDate" onFocus="this.blur();calendarA.popup()">
<input type="text" name="EndDate" onFocus="this.blur();calendarB.popup()">
<input type="text" name="FollowUpDate" onFocus="this.blur();calendarC.popup()">

var calendarA = new calendar2(document.forms['ActivityForm'].elements['StartDate']);
var calendarB = new calendar2(document.forms['ActivityForm'].elements['EndDate']);
var calendarC = new calendar2(document.forms['ActivityForm'].elements['FollowUpDate']);

Back to forum: