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

Question

Question

Reusing Field Values

asked on September 25, 2015

First post, i couldn't find any other questions in the answers section, but i could have missed one.

I'm looking to fill out some form fields based on previous field values.

So i'm trying to pass the value of #q2 into #q27. Does this have to be implemented in javascript, or can it be done using the variables or default values.

1 0

Answer

SELECTED ANSWER
replied on September 25, 2015 Show version history

It can be done with defaults if the form already has already gathered the information in a previous submission.

https://answers.laserfiche.com/questions/27471/How-do-you-fill-out-one-form-with-data-from-another-form

 

 

If it's being re-used within the same form submission, you'll have to add in JavaScript to apply the field value of #q2 into #q27 and under what type of event or condition. 

 

$(document).ready(function(){

    $('#q2').on('blur', 'input', fill);
                     
    function fill() {                     
      $('#q27 input').val($('#q2 input').val());
    };

});

 

 

**edited to include corrections to code. The above code will populate the input field in #q27 with the value of #q2's whenever the user clicks away from #q2.

1 0
replied on October 2, 2017

I know this is a shot in the dark since it's been 2 years since this was posted, but is there a way to use that JavaScript to fill a radio button that has been filled in earlier on the same Form submission?

Thanks

0 0
replied on October 2, 2017

Hi Molly, I'm not sure I understand the question. Is the situation a user is filling out a form and makes a radio button selection, and later down the page of the same form, for the same user, the desire is to have a different radio button question answered base upon the first one?

 

If so, that can be setup with javascript. Here is a tutorial on making  a check on a radio input for starters. https://www.tutorialrepublic.com/faq/how-to-check-or-uncheck-radio-button-dynamically-using-jquery.php

 

Cheers,

Carl

 

0 0
replied on October 4, 2017

Thanks Carl,

The client has a Form that their retiree's are filling out and they are filling out their information as well as making a gender selection in the top section of the form. They then have the retiree select who will be covered by their benefits and one of the selections is "Self". If they select "Self" they want all of the information to be populated in that section that they already filled out previously.

I'll give the code you linked to a try.

 

Thanks!

0 0

Replies

replied on September 25, 2015

Thanks Carl!

I've got that working on one page of my form.

I forgot to add that i'm using the bpm251 pagination example. Now I'm trying to copy the value of #q6 to #q32, but #q32 is hidden until the user clicks the next button to access page 2 of the form. Any Ideas?

replied on September 25, 2015

Thanks for all of your help Carl! It would be nice if it was a feature in LFF but i'm glad we can accomplish this using javascript!

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

Sign in to reply to this post.