I have a similar issue. I have two forms in one forms project, start and print. I need the filled out form saved as PDF to the repository. The start form hides and shows parts of the form based on answers. At the point the form is ready to save to the repository as a PDF a submit button is shown. If the system would simply save the form in its current state in the browser, all would be well and I wouldn't need a print form. It however does not, the save to repository as PDF re-runs the entire form from the beginning. Since there is now no one to answer the questions nothing is shown except the first question, everything else is hidden.
This is the reason for the print form in the project. I have access to all of the standard forms variables that have been peen populated in the start form by coping the start form into the print form the two forms share data. What I cant get to work is the custom HTML. I can use jquery to insert static date into a div’s html, but can’t get it to take the data from a standard single line field containing the required data. I am also showing the hidden filed “hRev” in the saved PDF so I can see that is does have the required data.
When I do the following tried with and without “.change()”:
$('.rev').html('Rev: ' + $('.hRev input').val()); //the output is: “Rev:” without quotes.
$('.rev').html('Rev: ' + $('.hRev input').text()); //SAME
$('.rev').html('Revx1: ' + $('.hRev').text()); //I get the following, with my data clearly stuck inside “Rev: 2018/04/10”.
Revx1: hRevfield type single lineRev: 2018/04/10hRevInput blocked. Maximum character limit of 4000 characters reached.
I just can’t extract from or load into the custom HTML of the print form. It works just fine in the start form.