I am using out of the box address field. Is it possible to add a third address line to the same field?
Question
Question
Replies
If you are willing to have the value of the line 3 be stored in a separate variable than the rest of the address fields - then here is a way to do it...
Add the address field to the form. I gave mine a variable name of address_test, and confirmed it had an ID of q1. If yours is anything other than q1, you'll need to edit line 3 of the script below.
Add a single line field to the form. I gave mine a variable name of address_test_line_3, and confirmed it had an ID of q2. If yours is anything other than q2, you'll need to edit lines 4 and 5 of the script below.
The variable names don't actually matter to make it work, I'm just including them to compare to the screenshot below.
This script takes the single line field and moves it's input compenent inside the address block, creates a new label for the field (structured the same way as the other labels in the address block), and then hides the parts of the single line field that were left behind.
$(document).ready(function (){ $('#Field1_DSG1').parent().after('<div class="cf-full"><label class="cf-helptext" id="Address3_Label">Address Line 3</label></div>'); $('#q2 .cf-field').insertAfter('#Address3_Label'); $('#q2').hide(); });
Here's how the form looks:
It still works with the read-only/archive version of the form:
But, as mentioned, the variable for the address 3 line is separate from the other address variables: