Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

clearing fields

Avatar

Former Community Member

Hello,

I have some fields set up with error messages. for example in a date field, if the user enters a date in the future and tabs out of the field, an error message appears indicating that the date cannot be in the future.

The problem with this form is that it is not going to be a submittable form. They will just print it out and mail/fax/email it in. Therefore when the error message appears I would like the field to clear but I cant figure out how to do that. I am assuming I need to put something in the exit event, but I am unsure what code I should be using.


Is there anyone that is able to help?

Thank you in advance!


Nik

1 Reply

Avatar

Level 10

Hi,

as I don't know how you currently check your date values, I'm just guessing.

Here's the way I would do with a FormCalc script in the exit event of a date field.

if (Date2Num($.formattedValue, "MM/MM/YYYY") > date()) then

          $host.messageBox("Date connot be in the future")

          $ = ""

endif