CalcBuilder Forum

Date ()

User Johnjuhl 2015-06-18 15:03:01

How do I set a field to always show "today" - and not allowing the user to change that ?

J-)

Moonsoft support 2015-06-18 20:46:39

Hi,

You can use datepicker functions on a field typed 'date'. Add this code on first tab of 'Javascript events'on your calculator, replacing 'today' with the variable name of your field.:

CB("input").datepicker({ minDate: 0, maxDate: 0});
CB("input").datepicker( "setDate", "+0" );

More information about datepicker can be found here: https://www.moonsoft.es/en/help/2-cbsupport/2809-validate-date

Regards,

...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!