everisk Posted October 1, 2008 Share Posted October 1, 2008 Hi, I am using jQuery date picker from http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/. It works great but then I have a function where user can add more row in the table (via AJAX and PHP) and in the new row should also have the date picker. However, the date picker broke and just doesnot show up in the new row. Please help~ Many thanks in advance. Below is cut from my code <head> <link type="text/css" rel="stylesheet" href="datePicker.css"> <!-- jQuery --> <script type="text/javascript" src="Scripts/jquery-1.2.1.js"></script> <!-- required plugins --> <script type="text/javascript" src="Scripts/date.js"></script> <!-- jquery.datePicker.js --> <script type="text/javascript" src="Scripts/jquery.datePicker.js"></script> <script type="text/javascript" charset="utf-8"> $(function() { $('input.date-pick').datePicker({startDate:'01/01/2005'}).val(new Date().asString()).trigger('change'); $('input.calendar-start').datePicker({startDate:'01/<?php print date("m");?>/<?php print date("Y");?>'}); }); </script> </head> <body> <table> <tr> <td><input type="input" name="start_date[0]" id="start_date[0]" size="11" maxlength="10" class="calendar-start" value=" " /></td> </tr> <tr> <td><a href="javascript:addMoreRow();">[add more row]</a> | <a href="javascript:removeRow();">[remove row]</a></td> </tr> </table> </body> In the PHP file to add more row Nothing in the head section .. just some PHP code . .no javascript call to jQuery . I did try to add javascript call to jQuery and etc. but still it doesn't work <table> <tr> <td><input type="input" name="start_date[<?php print $sno;?>]" id="start_date[<?php print $sno;?>]" size="10" maxlength="10" class="calendar-start" value="" /></td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.