datamerc Posted April 2, 2010 Share Posted April 2, 2010 I'm creating custom pages for my client portal. Some of the forms require a date field and I would like to make them just like what is used in the admin section (for example, on the registration date field on the domains page of a client). How can I utilize that same pop-up calendar in my custom pages? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
datamerc Posted April 6, 2010 Author Share Posted April 6, 2010 After many days, I've made some progress in getting this worked out - except one problem. In header.tpl, I have included the following: <link rel="stylesheet" type="text/css" href="includes/jscript/css/ui.all.css" /> <script type="text/javascript" src="includes/jscript/jquery.js"></script> <script type="text/javascript" src="includes/jscript/jqueryui.js"></script> {literal}<script> $(document).ready(function(){ $(".datepick").datepicker({ dateFormat: "{/literal}{$datepickerformat}{literal}", showOn: "button", buttonImage: "images/showcalendar.gif", buttonImageOnly: true, showButtonPanel: true }); {/literal}{$jquerycode}{literal} });{/literal} {$jscode} </script> In my newform.tpl file, I have the following field for the date: <input type="text" name="date_from" class="datepick"> The calendar looks and pops up properly. However, when a date on the pop-up calendar is clicked on, a text date (MM/DD/YYYY) is not put into the field, it is just blank. I can't figure out why this doesn't work - do the form fields have to be registered somewhere? Thank you for any help!!! 0 Quote Link to comment Share on other sites More sharing options...
datamerc Posted April 7, 2010 Author Share Posted April 7, 2010 One difference I have noticed between my created page and the original admin page, is the link url when hovering over a date in the calendar. On the original admin page, the date link is: http://www.domain.com/whmcs/admin/clientsdomains.php?userid=21#'>http://www.domain.com/whmcs/admin/clientsdomains.php?userid=21# when the page url is http://www.domain.com/whmcs/admin/clientsdomains.php?userid=21 On my created page, the date link is just: http://www.domain.com/whmcs/# when the page url is http://www.domain.com/whmcs/21.php?action=test_calendar As you can see, my created page is not setting a proper link within the calendar (which it is probably returning a blank result to the date form field). What have I missed??? 0 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.