Edition: Hotdocs Classic
I'm trying to pre-fill answers for a user based on a MC selection. But I just want it as a 'pre-fill' not a set.
When I use the script below, it basically 'greys out' the fields. The user can't edit it.
I want the fields to be pre-filled like a normal "DEFAULT" function and the user can still edit it.
But in the below, the DEFAULT works like "SET" and it locks the entry in and the user is no longer able to edit.
I feel like I'm missing a trick here.
This is what I have in the Repeating Dialog script:
//Populate the multichoice variable with names of the owners from previous screen.
CLEAR partyPopulatePartyWithOwner
IF ANSWERED(own1FirstName)
ADD "owner1|«own1FullName»" TO partyPopulatePartyWithOwner
END IF
IF ANSWERED(own2FirstName)
ADD "owner2|«own2FullName»" TO partyPopulatePartyWithOwner
END IF
//Auto-populate name field if user selected to auto-populate
IF partyPopulatePartyWithOwner = "owner1"
//Erase incase the owner has changed their mind (selected owner2, and now selects owner1)
ERASE partyFirstName
ERASE partyMiddleName
ERASE partyLastName
DEFAULT partyFirstName TO own1FirstName
DEFAULT partyMiddleName TO own1MiddleName
DEFAULT partyLastName TO own1LastName
ELSE IF partyPopulatePartyWithOwner = "owner2"
//Erase incase the owner has changed their mind (selected owner1, and now selects owner2)
ERASE partyFirstName
ERASE partyMiddleName
ERASE partyLastName
DEFAULT partyFirstName TO own2FirstName
DEFAULT partyMiddleName TO own2MiddleName
DEFAULT partyLastName TO own2LastName
END IF
ERASE does not functioning properly in my view. What is happening is that you DEFAULT a value, the default is ERASEd and then value is DEFAULTed again so it looks a a SET. ERASE should limit its functionality to the particular dialog in which it is used but it doesn't. It affects all. I have learned over time that ERASE is to be avoided at all costs.