Copy link to clipboard
Copied
Hello,
I have this form where two fields cannot have a value at the same time: if one is filled, the other must be set read-only. I tried adding the following script as a custom calculation in both fields (say, name1 and name2):
In the field Name2:
if (event.value=="")
{this.getField("Name1").readonly = true}
else
{this.getField("Name1").readonly = false}
Similarly, I use the same script (changing "name1" to "name2"), which results in both fields being read-only.
I would need both of them to be fillable until one is not blank anymore. It would be great if, when erasing the data from that field, the other became fillable again (in case it was a mistake), although I don't know if that would be possible.
Also, and forgive me if I should have posted a different question for this, I would like to know if there is a way to show something similar to a non-printable comment (not popup, I wouldn't want to have to close it everytime) once either of the two is active with a warning about the other field being locked. Everything I've found is about either tooltips or pop-ups, but I have been unable to find this particular case.
Thank you!
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now