added validation for uploading a photo. Users must select a photo before they hit the upload button.

This commit is contained in:
mb863 2010-07-01 19:10:34 +00:00
parent 98b71db1f4
commit e50507efee
2 changed files with 24 additions and 1 deletions

View file

@ -2,6 +2,8 @@
<#-- Upload a replacement main image for an Individual. -->
${scripts.add("/js/imageUpload/validateUpload.js")}
${stylesheets.addFromTheme("/uploadImages.css")}
<#if errorMessage??>
@ -14,7 +16,7 @@ ${stylesheets.addFromTheme("/uploadImages.css")}
<h6>Current Photo</h6>
<img src="${thumbnailUrl}" width="115" height="115" /> </div>
<div id="photoUploadForm">
<form action="${formAction}" enctype="multipart/form-data" method="post">
<form action="${formAction}" enctype="multipart/form-data" method="post" onSubmit="return validate_upload_file(this)">
<label>Upload a photo <span> (JPEG, GIF or PNG. Max Size: 50 MB)</span></label>
<input type="file" name="datafile" size="30">
<input type="submit" value="Upload photo"> or <a href="${cancelUrl}">Cancel</a>