You are viewing limited content. For full access, please sign in.

Question

Question

dynamic picture saving to laserfich

asked on January 20, 2016

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?

 

0 0

Answer

SELECTED ANSWER
replied on January 21, 2016

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);
});

3 0

Replies

replied on January 21, 2016

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.

0 0
replied on January 21, 2016

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 ?

0 0
replied on January 21, 2016

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).

0 0
replied on January 21, 2016 Show version history

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 ???

 

0 0
SELECTED ANSWER
replied on January 21, 2016

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);
});

3 0
replied on January 21, 2016

Great it's working now thank you Rui Deng

0 0
replied on August 30, 2017

Thank you, Rui!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.