Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have an infopath form with 4 buttons, each button corresponds to a different view. When the form loads, only first 2 buttons are visible and when users fills in the fields in the first two buttons(views) submits the forms. When the same form is open, now the last two buttons become visible. Now the problem is that i have a required date field in the 3rd view, so when i try to submit the form for the first time(i.e filling only the fields in 1st and 2nd view), i get an error saying that the date field(which is in the 3rd view) "only dates allowed".

any suggestions?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Another option would be to set it as an optional field so it isn't required on submit and on edit, use rules to make it a required field (and disable and submit buttons until a value is supplied).

share|improve this answer

I've been banging my head on some walls lately with just that issue. Date fields and InfoPath don't seem to always play nice.

To help with troublshooting, you may want to create a calculated field and set it to the value of the problem date field. When previewing the form, you will see a text in the format

yyyy-MM-ddTHH:mm:ss

If that calculated field's text is missing some of these aspects, the field will not be accepted as a date field.

I have experienced that entering "1/1/2013" manually in the date field may (or may not!!) render an invalid date, but selecting the same date from the date picker works just fine. I have so far not found what magic is required for a manually entered date to work, or what differentiates a manually entered date from a date picked with the date picker.

You can try formulas to ensure that the date field is getting the entry it requires, for example with ...

concat(substring-before(TheField,"T"),"T","00:00:00")

... but this only seems to work sporadically in my environment.

Picking the date from the date picker seems to work best.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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