How to make it so that when you submit a form you need to attach a file?
- Add <input type = "file" required = "true"> to the form. Additionally, before submit, you can check this field for fullness using JavaScript - carapuz
- here you can use jqueryvalidation.org/extension-method - soledar10
- example jsfiddle.net/soledar10/6pt1tkdu - soledar10
|
1 answer
HTML5 simply requires
document.getElementById("myFile").required = true; Description: http://www.w3schools.com/jsref/prop_fileupload_required.asp
A working example: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_fileupload_required2
|