Dari
Dari

Reputation:

Javascript calendar issue

What am I missing in my code to make display the calendar in my form. I get error object expected. C#

http://www.martinesexpress-inc.com/PhoneControl/MyOrders.aspx

<style type="text/css">
    .style1
    {
        width: 100%;
    }
</style>
</head>

</div>
<table class="style1" style="width:100%; color:black; background-color:orange; outline-color:Green; ">
    <tr>
        <td><b>Enter Start and End Dates</b></td>
    </tr>
</table>
<p>
    &nbsp;</p>
<table class="style1" style="width:100%; color:black; background-color:orange; outline-color:Green; ">
    <tr>
        <td>
            &nbsp;</td>
        <td><b>
            Start Date</b></td>
        <td><b>
            End Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            <asp:PlaceHolder ID="phGoBack" runat="server">Go <a class="link" href="Default.aspx">Back</a></asp:PlaceHolder>
            </b></td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>

                    <asp:TextBox ID="txtFrom" CssClass="fields" runat="server"></asp:TextBox>&nbsp;
                    <img alt src="images/cal.gif" onclick="displayDatePicker("txtFrom");" />
        </td>
        <td>
                    <asp:TextBox ID="txtTo" CssClass="fields" runat="server"></asp:TextBox>
                    <a href="javascript://"><img alt src="images/cal.gif" onclick="displayDatePicker('txtTo');"  /></a>

        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            <asp:Literal ID="litCountRecords" runat="server"></asp:Literal>
        </td>
        <td>

            <asp:Button ID="btnRun" runat="server" onclick="btnRun_Click" Text="Run" 
                Width="37px" />

Upvotes: 0

Views: 322

Answers (2)

Greg
Greg

Reputation: 2271

Usually when you get:

[NullReferenceException: Object reference not set to an instance of an object.]

You're trying to use "something" that isn't an instance of an object/class.

Can we see some code behind?

Upvotes: 1

Russell Steen
Russell Steen

Reputation: 6612

to pass a control to javascript, you use (this) not ('txtTo')

but that doesn't look like your problem.... this is not a jscript error.

Upvotes: 1

Related Questions