jquery - cannot view calendar in HTML table -
i have html table, contains startdate
, enddate
. want show calendar select date while clicking text boxes. select date calendar selected date display in text box. used following code. not working , not showing errors. problem code? modification need in code? or best way view calendar view in field?
<!doctype html> <html> <body> <script src="http://localhost/js/jquery.js"></script> <script src="http://localhost/js/jqueryui.js"></script> <script> function calendar1(){ $( "#startdate" ).datepicker(); } </script> <table id='tblappend' bgcolor='#d2dfef'><col width='170'><col width='30'><tr><td>portfolio name:</td><td><input type='text' name='name'></td></tr> <tr><td>start date</td><td><input type='text' name='startdate' onclick='calendar1();'/></td></tr> <tr><td>start date</td><td><input type='text' name='enddate' onclick='calendar1();'/></td></tr> </table> </body> </html>
try this, working fiddle
html code
<p>date: <input type="text" id="startdate" /></p> <p>date: <input type="text" id="endtdate" /></p>
jquery code
$(function () { $("#startdate , #endtdate").datepicker(); });
Comments
Post a Comment