Does anybody know if does exist a widget in dojo to have the preview of an uploaded image ?
It the moment i submit and store the image on the server but I would like to display an image preview before to submit the form.
![]() | It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!) |

|
|
<!-- image preview -->
<script language="javascript">
var imgRe = /^.+\.(jpg|jpeg|gif|png)$/i;
function previewImage(pathField, previewName) {
console.log(pathField.value);
var path = pathField.value;
if (path.search(imgRe) != -1) {
document[previewName].src = 'file://'+path;
console.log( 'file://'+path);
} else {
alert("JPG, PNG, and GIFs only!");
}
}
</script>
Users browsing this forum: No registered users and 7 guests