Make multiple linked fields editable without changing the others
Hi All!
I’d like to preface by saying I am a complete noob at scripting and appreciate any help I can get.
I am tasked with creating a document for work that maps from our core system. The main mapped field is named “borrower(s) legal name(s)” which comes from a single application note in our core. This means all borrowers have to be entered into one field, separated by entering to the next line, i.e. 4 borrowers the one mapped field would come over like this:
John Smith
Mary Smith
Joe Smith
Moe Smith
These names need to be split individually into 8 more fields on the last two pages, with each name having one line on each page, i.e second last page has borrower names, so.. Borrower 1=John Smith, Borrower 2 = Mary Smith, etc.. Last page has present party names for notary, i.e. Present Party 1 = John Smith, Present Party 2 = Mary Smith.
I created 4 fields (“legal1” “legal2” legal3” “legal4”) and added them to page 8 and 9 next to each corresponding name (Borrower 1 = “legal1”, Present Party 1 = “legal1”). I then made the following script in “borrower(s) legal name(s)”
for (var i=1; i<=4; i++) this.getField("legal"+i).value = "";
var lines = event.value.split("\r");
for (var i=0; i<lines.length; i++) this.getField("legal"+(i+1)).value = lines[i];
This works perfect and splits the 4 names from one field into each individual field. Great, right? Nope. We now have an employee who is stating that SOMETIMES the Present Part name wont be the same as the legal name and borrower 1 name, i.e. John Smith is incapacitated and has an agent signing for him, so the legal name and Borrower 1 name should be John Smith but in the notary section the Present Party name should be Tom Smith as agent for John Smith.
I cannot figure out how to allow them to edit one of those linked fields without changing the other. If they back out the field in the Present Party section and change it to Tom Smith as agent for John Smith it automatically changes the Borrower 1 name because they are BOTH named “legal1”.
Is there any way I can accomplish this?
Sorry if that doesn’t make sense, I can add a picture of what I mean if that is helpful!
