View Single Post
  #5  
Old 04-05-2017, 03:07 AM
  kvatchinsky's Avatar 
kvatchinsky kvatchinsky is offline
 

Newbie
  
Join Date: Nov 2016
Posts: 7
 

Default Re: Calendar - Datepicker

here is the js i did and load fine, I tried to add as custom JS section of the X-Cart 5, in this particular js date piker, the calendar is just form of display for actual text entry, all data input is processed and transferred to the server as text input, so should work, the issue i have is that I'm getting error from x-cart 5 that the link / script.src = / the javascript source file should be allowed in the X-Cart settings file / authorized. I dont have idea how to do that without getting errors after every next new update.

The attribute ID=93 is the existing text filed attribute ID and using javascript DOM we can replace the current front end display with the javascript date picker, the data input is text by nature so it will be pass and displayed by the server in back side as is done now

Code:
var script = document.createElement('script'); script.src = "https://cdnjs.cloudflare.com/ajax/libs/pickadate.js/3.5.6/compressed/picker.js"; script.onload = function () { $(document).ready(function () { $('textarea[data-attribute-id="93"]').datepicker(); }); console.log("script loaded") }; document.head.appendChild(script);

Do you have any idea if that can be make to work?

Thanks !!
__________________
X-Cart Free 5.3.2.9
Braintree payment gateway 5.3.2.1
MailChimp Integration with Ecommerce-360 support 5.3.2.3
Reply With Quote