Hi
Modx 2.2.10
Formit : 2.2.0
HTML 5
Question is about W3C validation for Formit with attachment.
My form is working very well. It is about his W3C validation
From my form :
<p><label for="document">Joindre votre CV (Word ou PDF)
</label><span class="error">[[!+fi.error.document]]</span> <input type="file" id="document" tabindex="3" name="document" value="[[!+fi.document]]"></p>
From W3C Validation Service
Validation Output: 1 Error
Line 299, Column 169: Attribute value not allowed on element input at this point.
…n> <input type="file" id="document" tabindex="3" name="document" value=""/></p>
If I remove « value="[[!+fi.document]]" » the form still working perfectly and it pass the W3C validation.
My question, can I remove « value="[[!+fi.document]]" » without causing any problem or it is mandatory?
Thanks
[ed. note: jber last edited this post 12 years, 10 months ago.]
Yes, an input field of that type can't have a value attribute, so removing it should be fine. The only annoyance is that if there's an error and the form doesn't submit, the user may have to re-select the file. JavaScript validation could prevent that from happening.
Thank you for your reply Bob Ray.
Glad I could help.