added validation for uploading a photo. Users must select a photo before they hit the upload button.
This commit is contained in:
parent
98b71db1f4
commit
e50507efee
2 changed files with 24 additions and 1 deletions
21
webapp/web/js/imageUpload/validateUpload.js
Normal file
21
webapp/web/js/imageUpload/validateUpload.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
function validate_upload_file(form_passed) {
|
||||
|
||||
var msg="";
|
||||
|
||||
if (form_passed.datafile.value == "") msg += "Please browse and select a photo\n";
|
||||
|
||||
|
||||
if (msg == "") {
|
||||
|
||||
document.form_upload_image.submit();
|
||||
|
||||
|
||||
} else{
|
||||
|
||||
alert(msg);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue