Vinod
Vinod

Reputation:

Javascript calendar not working

My JavaScript calender is working in IE but it is not working in Mozilla.

My code:

  <table>
   <tr style="height: 5px;">
    <td>
     <asp:TextBox ID="txtBorderedDate" runat="server" CssClass="TextBoxMandatory" Enabled="false"></asp:TextBox>
    </td>
    <td class="FieldButton_bg" style="height: 5px;"> 
     <a onclick="javascript:showCalendarControl(ctl00_SaralConetentPlaceHolder_txtBorderedDate);" href="#">
       <img src="../Images/iconCalendar.png" style="width: 20px; height: 20px; vertical-align: bottom;" border="0" />
     </a>
    </td>
   </tr>
  </table>

Upvotes: 1

Views: 1027

Answers (1)

M4N
M4N

Reputation: 96561

I'm not sure if this has anything to do with the problem (you should post some more of your code), but you shouldn't hard code the ID of the controls in ASP.NET. Also, I think some quotes might be missing in the showCalendarControl() call.

Replace this:

<a onclick=
 "javascript:showCalendarControl(ctl00_SaralConetentPlaceHolder_txtBorderedDate);" ...

With this:

<a onclick="showCalendarControl('<%= txtBorderedDate.ClientID %>');" ...

Some of the parent controls of txtBorderedDate might get rendered differently in different borders, thus resulting in a different client-side ID of the textbox control.

Upvotes: 1

Related Questions