Skip to content

Instantly share code, notes, and snippets.

@jagjeetgit
Last active March 24, 2025 23:05
Show Gist options
  • Save jagjeetgit/6589efb362baf41e5b0ffaa418f8cd6c to your computer and use it in GitHub Desktop.
Save jagjeetgit/6589efb362baf41e5b0ffaa418f8cd6c to your computer and use it in GitHub Desktop.
Value Commit script for Photograph type Image Field in Adaptive Form
function readImage (file) {
var reader = new FileReader();
reader.addEventListener("load", function (e) {
$(".guide-fu-fileItemList").hide();
var image = new Image();
$(".photo-upload .preview .imageP").remove();
$(".photo-upload .preview .text").remove();
image.width = 170;image.height = 220;
image.className = "imageP";
image.addEventListener("load", function () {
$(".photo-upload .preview")[0].prepend(this);
});
image.src = window.URL.createObjectURL(file);
});
reader.readAsDataURL(file);
}
readImage($(this.fileList[0])[0].files[0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment