| Project: | formsPlayer |
| Version: | 1.5.1 |
| Component: | Code |
| Category: | bug |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
See: http://www.formsplayer.com/node/630
The problem is that when the date field is REQUIRED, the form "appears" to select a date (the current date), but when you go to submit the form, you get an error b/c that required field does not actually have a value. You actually need to use the date picker to select a date. I think b/c the date is required, the field sort of selects a date (vs leaving it blank), but not fully. I think the best option here is simply to leave the date blank when a date is required or when it's optional.
Updates
| Status: | active | » applied |
A fix for this issue has been applied, and will be available in a forthcoming release.
| Version: | 1.5.1 | » 1.5.1 |
| Status: | applied | » active |
It is still not working for me. I have not noticed any change since upgrading to version 1031. When I have a required date field, the field always APPEARS as if a date has been selected (the current date), but when I go to submit, i get an error b/c no date has been selected. (When I do select a date, I submit just fine.) I would recommend that, on the front end, a required date field looks like an optional date field, with a checkbox needed to be checked to activate the date field.
| Attachment: | 832.html.txt (3.14 KB) |
The attached form (832.html) has four inputs bound to nodes of type xsd:date and xforms:date specified in a variety of ways. All nodes are required, and empty on startup.
In 1.5.1.1031, for me, each control looks like an optional date, until checked, at which point, the checkbox disappears. If this form works as expected for you, could you provide an example form that demonstrates the erroneous behaviour?
| Attachment: | 832-a.jpg (33.9 KB) |
The attached screenshot demonstrates how I see 832.html on opening.
I found an issue with my code that was causing this problem. However...
B/c of a shortcoming (perceived or real, I'm not sure) with xforms:date, whenever I had a new form with an empty date field, I would prepopulate the model with the current date before the page loaded. That seems to be the cause of the problem. Now, with a new form, I just leave the date field blank and the form comes up just the way you indicated. I need to hit the checkbox then enter a date. It submits appropriately.
However, I have now traded one problem for another. Now when I go to revise an EXISTING form that contains a date in a required field, I am not able to submit that form b/c of a problem with the required date field. (The form does indicate that the date field has a value and if I look in the source, the date field has a value in the model.) On submission, the form does not get validated and the server is never contacted. I have tried to change the date using the date picker, just to be sure that a date has been selected, but it still fails to submit.
To test out my hypothesis, I turned validation off on the submission and it submitted. So it seems clear that there is a problem validating a form with required date fields when a value exists.
| Attachment: | 832.html_0.txt (9.3 KB) |
I am unable to reproduce the behaviour you describe with the information provided.
The attached form contains a set of instances each with required date fields, and a set of validating submissions that send these instances to an echo page.
The first five are empty, and will not submit without setting the respective date value, changing the values allows the appropriate submit to work.
The second five are populated from the initial instance data, and will submit without changing the data.

Recent comments
14 weeks 3 days ago
14 weeks 3 days ago
18 weeks 14 hours ago
19 weeks 3 days ago
19 weeks 4 days ago
19 weeks 4 days ago
19 weeks 6 days ago
19 weeks 6 days ago
19 weeks 6 days ago
19 weeks 6 days ago