javascript - Calling JS Function when The tag contains duplicate 'ID' attributes -
i want call js function can jquery calendar when click on text box showing error. want know how can use both attributes txtexpiry , datapicker? or there other way ?
here code of text box
<asp:textbox id="txtexpiray" runat="server" id="datepicker" clientidmode="static" width="70px"></asp:textbox>
here function
<script type='text/javascript'> $(function () { $('#datepicker').datepicker(); }); </script>
you can't use duplicate id attributes - or duplicate attributes matter (id attributes should unique page).
you can this:
<asp:textbox id="txtexpiray" runat="server" clientidmode="static" width="70px"></asp:textbox> <script type='text/javascript'> $(function () { $('#txtexpiray').datepicker(); }); </script>
Comments
Post a Comment