Copy link to clipboard
Copied
I have a form that I am building that has a drop box that will auto populate a text field based on what the end user selects.. I also need the user to be able to overwrite that information with their own in the populated text field. I’ve searched, but cannot find a solution that works for what I need. When the populated text is overwritten, it defaults back to the original text. Any help would be appreciated., thank you.
Copy link to clipboard
Copied
Hi,
Did you have a look on this post:
Here is an other example with a drop down box.
@+
Copy link to clipboard
Copied
From your description I'm assuming that your autopopulate script is in the calculate event in the text field? If so then delete it.
Put the script for auto-populating the text field in the "Validation" script for the dropdown. Then data in the text field can be overwritten manually.
Copy link to clipboard
Copied
I am working on an issue like OP and your advice helps with being able to add text into the text box, but now the output is delayed and doesn't display until another calculation is run.
I tried calculateNow to no effect.
If I move the script back to the Calculate tab it refreshes on time, but goes right back to the OP problem.
Can't set Field Calculation Order for Validation scripts.
Copy link to clipboard
Copied
Is the dropdown set to "commit selection immediately"? This may be the issue.
Validation script run on a field when the value of that field is modified. Ordering has no meaning in this context.
Copy link to clipboard
Copied
Yeah, meant to add that the Commit selection was engaged, but no edit function.
I understand ordering has no meaning, just checking off all of the "what if it was X?" things that I could think of with my novice brain.
Copy link to clipboard
Copied
Can you post the form?
Copy link to clipboard
Copied
Page 1.
Dropdowns: Calling, Culture, & Background.
I was testing variants of what could go in Validate vs Calculate, so some of the data is split.
When it's in Validate, if you select a Background, it gives delayed response when Validate but allows for appending text.
When in Calculate, it does not delay updates but doesn't let one change the data (forces it to reset to the output).
Copy link to clipboard
Copied
In a validate script the value of the newly selected item is in "event.value". Your scripts are using getField to acquire the field the script is in. This gets the previosly selected value, because the field value doesn't change until after validation is complete.
However, if you really wanted the field object, it is in event.target. So no need to use the getField function.
Copy link to clipboard
Copied
Hi,
Did you have a look on this post:
Here is an other example with a drop down box.
@+
Copy link to clipboard
Copied
Thank you! This worked.