Changes

Jump to navigation Jump to search
514 bytes added ,  07:54, 5 October 2015
add current date example
\stoptext
</texcode>
 
===Setting the current date===
This is more usable than the example above:
 
<texcode>
\startJSpreamble {EXAMPLE}
function setCurrentDate(fieldname) {
var f = this.getField(fieldname);
f.value = util.printd("yyyy-mm-dd", new Date());
}
 
setCurrentDate("myDateField");
\stopJSpreamble
 
\setupfield[dateString][reset,horizontal][width=5em,option=printable]
\definefield[myDateField][line][dateString][][]
 
</texcode>
 
=Fields=
</texcode>
=Tricksand TrapsBeware, there is no {{cmd|setupfields}} (plural), at least in MkIV as of 2015-10-05.
This helps debugging (MkII only!):

Navigation menu