Following a comment…
If the code is within the field where the date should appear, the syntax has to be modified, because a field can not reference to itself via its name.
The code can be placed at two places, depending on how the field is used. If it is the result of a calculation (or part of a calculation), it would be in the Calculate event of the field, and the code would look like:
event.value = util.printd("mm/dd/yyyy", new Date() ) ;
and that's already it. Using this event means that the date will be updated every time, some value somewhere in the form gets changed (because it is part of the Calculation chain).
If the current date should appear when the user clicks in the field, you would run the following in the MouseDown event (the more logical MouseUp does not work in this case):
event.target.value = util.printd("dd/mm/yyyy", new Date() ) ;
and that's it again.
Hope this can help.
Max Wyss.
BTW, shameless plug: I happen to have developed a date picker which is very lightweight, and highly and easily configurable (and which does display the correct date for any day). If interested to license it, feel free to contact me in private (the eMail address is in my profile).