Data Validation II

S

Simba

I have a date picker field on my form. I want the date picker field to only
show the date and nothing else. Currently, I can type in some text and it
will show the text in the date picker field, with the inline alert around it.
I want an error message shown and also, I want the box cleared and the cursor
returned to that field after a user click 'OK' in the message box. I hope I'm
making myself clear. Can anyone help?
 
S

S.Y.M. Wong-A-Ton

To show a message box: Use the "Data Validation" button on the properties
dialog box of the date picker to add a validation rule that says something
like:

datefield does not match pattern custom pattern 0000-00-00

and select alert type "Dialog box alert (show alert immediately)". The
custom pattern must be entered as \d\d\d\d-\d\d-\d\d in the Data Entry
Pattern dialog box.

To clear the field when an invalid date has been entered, add a rule on the
date picker with an Action that says:

Set a field's value: . = ""

with a Condition on this rule that says:

datefield does not match pattern custom pattern 0000-00-00

Note: Users will be forced to enter dates in the format yyyy-mm-dd (e.g.
2001-03-21, which is March 21, 2001).

For more information see
http://office.microsoft.com/en-us/infopath/HP010972021033.aspx?pid=CH01109705103
http://office.microsoft.com/en-us/infopath/HP010967511033.aspx?pid=CH01109705103
http://office.microsoft.com/en-us/infopath/HP011002671033.aspx?pid=CH011097041033
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top