Board Logo

cal is null or not an object
jcarriere - 5/13/2008 at 07:05 PM

I had resolved this problem, but it has reappeared. I am not sure what to check. I can find the error message, but can't seem to resolve it. Code excerpts below"
<html><head runat="server"><script language="javascript" type="text/javascript">
function FillValueFromPopup(popupvalue)
{
document.getElementById('<%=txtProductNo.ClientID%>').value = popupvalue;
}
function DoOnClick() {
window.open("orderhistory.aspx");
}
</script>

<script language="javascript" type="text/javascript" src="calendar2.js"></script>


Cal1 works just fine
Cal1 does not work
Here is the call from the button for cal1
<asp:TextBox runat="server" id="txtInstallDate" Height="22px">
</asp:TextBox>
<a href="javascript:cal1.popup();">
<img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date" />
</a>
Here is the call from the button for cal2
<asp:TextBox runat="server" id="txtOutofService"></asp:TextBox>
<a href="javascript:cal2.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"/>
</a>

Here is the script at the end:
</form>
<script language="JavaScript" type="text/javascript">
<!-- // create calendar object(s) just after form tag closed


var cal1 = new calendar2(document.forms[0].elements['txtInstallDate']);
cal1.year_scroll = true;
cal1.time_comp = false;
var cal2 = new calendar2(document.forms[0].elements['txtOutofService']);
cal2.year_scroll = true;
cal2.time_comp = false;

</script>
</body>


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