Last active
March 24, 2025 23:05
-
-
Save jagjeetgit/6589efb362baf41e5b0ffaa418f8cd6c to your computer and use it in GitHub Desktop.
Value Commit script for Photograph type Image Field in Adaptive Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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