i created a form with javascript dynamic picture from database and it's working fine but when i save it to laserfiche repository the picture is empty!!! so how can i solve that?
i created a form with javascript dynamic picture from database and it's working fine but when i save it to laserfiche repository the picture is empty!!! so how can i solve that?
To get the value of a field on submitted form, you should use text() instead of val().
Try something like this:
$( document ).ready(function() {
var url1=$("#Field5").text();
$("#signature").attr("src",url1);
});
Hi there,
Please check the submission first. Make sure the View Submission has the correct information. Your javascript may need to be adjusted to make the static view also work.
this is the HTML code
----------------------------------------------------
<img id="signature" src="" alt="{/_currentuser_display}">
--------------------------------------------------
and the javascript for it :
--------------------------------------------------
$( document ).ready(function() {
$("#Field5").change(function() {
var url1=$("#Field5").val();
$("#signature").attr("src",url1);
});
});
------------------------------------------------------
where is :
Field5 : is variable ID recieved the value from database by lookup rules.
signature : is the image tag ID
so what is the problem in that and how do i reflect this on the View Submission ?
This is because the image is added by detecting a on change. There's no on change for a static page like View Submission. You can try add script that will be run as soon as document ready (page loads).
i tried
$(window).bind("load", function() {
var url1=$("#Field5").val();
$("#signature").attr("src",url1);
});
and
window.onload = function() {
var url1=$("#Field5").val();
$("#signature").attr("src",url1);
});
and
document.addEventListener("DOMContentLoaded", function() {
var url1=$("#Field5").val();
$("#signature").attr("src",url1);
});
nothing works ???
To get the value of a field on submitted form, you should use text() instead of val().
Try something like this:
$( document ).ready(function() {
var url1=$("#Field5").text();
$("#signature").attr("src",url1);
});
Thank you, Rui!