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

Question

Question

Reusing Address collection for a second applicant. Forms 9.1.1

asked on March 28, 2014

I have a loan application that may or may not require a co-applicant. In the cases where a co-applicant is required, they will need to fill out their home address. If the co-applicant lives at the same address as the primary applicant, how can I copy the data from the primary applicant to the co-applicant address collection?

 

A similar scenario would be a "Bill to" and "Ship to" address. If they are both the same I don't want the user to have to enter the data twice.

 

Thanks,

0 0

Answer

APPROVED ANSWER
replied on April 11, 2014 Show version history

As Devin mentioned, this is pretty straightforward with JavaScript. One catch is that there are several input fields within each address field, so you'll need to keep this in mind. Assuming you have two address fields (given the addressOne and addressTwo classes) and one checkbox (given the check class) with Yes as its option, the following code does what you're looking for.

 

$(document).ready(function () {
    $('.check').change(function () {
        var firstAddress = $('.addressOne').find('input');
        var secondAddress = $('.addressTwo').find('input');
        if ($(this).find('input[value="Yes"]').is(':checked')) {
            for (i = 0; i < 6; i++) {
                $(secondAddress[i]).val($(firstAddress[i]).val());
            }
        }
        else {
            secondAddress.val('');
        }
    });
});

 

 

 

0 0

Replies

replied on March 29, 2014

The only way to do what you're after is with JavaScript. I would start with this question for a basic overview of how to figure out what fields you need to manipulate, as well as some basic JavaScript and jQuery. I would expand on that a little bit and do something like this:

 

$(document).ready(function(){
    $(":checkbox").change(function(){
        if($(this).is(':checked[name=UseAddressElsewhere'])) {
     $('#Applicant2Address').val($('#Applicant1Address'));
        }
    });
});

 

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

Sign in to reply to this post.