0

I have a form for my custom SharePoint List that, and I need to make a date field 'read-only' after someone goes in and fills in the date.

What is the best way to do to this via InfoPath?

1

Use Formatting rule.

If the date field is not blank and it has valid value, disable this field control (make it read-only).

In the InfoPath form, the date value always in this format:
yyyy-mm-ddThh:mm:ss
(e.g. 2019-03-05T00:00:00-07:00 or 2001-03-05T00:00:00)

Using the following pattern to check if the date value is valid:

((([0-9][0-9])|([1-2][0-9][0-9][0-9]))-(([1-9])|(0[1-9])|(1[0-2]))-(([0-9])|([0-2][0-9])|(3[0-1]))T00:00:00)|((([0-9][0-9])|([1-2][0-9][0-9][0-9]))-(([1-9])|(0[1-9])|(1[0-2]))-(([0-9])|([0-2][0-9])|(3[0-1]))T00:00:00-0([0-9]):00)

Use the rule:

enter image description here

  • Hey, I appreciate you two helping out. Since I am fairly new to InfoPath. Can you please give me a step by step where to put this pattern? Also, just to make sure-- after I follow the steps above-- someone will be able to enter a date after a record has been loaded to SharePoint, but after they hit Submit, the data 'cannot' be adjusted? (which is a what we really want to happen) – Travis Horne Mar 5 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.