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?

<form>
<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()">
</form>

<script>
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']);
</script>

Thanks


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.

<form>
<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()">
</form>

<script>
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']);
</script>


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/