I am trying to post a Contour form through the API but get an exception: "System.FormatException: String was not recognized as a valid DateTime".
The datepicker is an empty string and is not marked as a mandatory field. Of course if I enter a date, it works just fine. However when I post the form through Contour itself, I am allowed to leave it empty.
How can I send an empty datepicker value to Contour?
Okay, just skipping the field in the foreach loop works, too bad that I have to explicitly check if the field is a datepicker and if it is null or empty. Would be nice if an empty string would just mean an empty string as the value. Similarly, I have to manually check if a checkbox has an empty string value and then set it to false, while empty could just implicitly mean false.
How to handle non-mandatory datepicker
I am trying to post a Contour form through the API but get an exception: "System.FormatException: String was not recognized as a valid DateTime".
The datepicker is an empty string and is not marked as a mandatory field. Of course if I enter a date, it works just fine. However when I post the form through Contour itself, I am allowed to leave it empty.
How can I send an empty datepicker value to Contour?
Comment author was deleted
And if you set it to null instead of an empty string (when there is no date set)?
Oh, the full exception got pasted in there after all, weird, didn't think it worked...
Anyway, no passing a null just gives me a nullreference exception. I'll try just skipping the field.
Okay, just skipping the field in the foreach loop works, too bad that I have to explicitly check if the field is a datepicker and if it is null or empty. Would be nice if an empty string would just mean an empty string as the value. Similarly, I have to manually check if a checkbox has an empty string value and then set it to false, while empty could just implicitly mean false.
is working on a reply...