I have created a drop-down list which includes various regions. When a region is selected it auto-populates another drop-down list with locations. I would like to auto-populate a text field with pre-determined phone numbers once a location is selected from the "locations" drop-down list. I want to embed the phone numbers in the code since the form will not be accessing a database. Any help would be greatly appreciated. Thanks, Ed.
Solved! Go to Solution.
Hi,
Here is the link to your form. https://acrobat.com/#d=BaCL7BKKdAcgV3JIk61nZg
You have field mis matches in the change event of 2nd DropDown.
While referencing it you are using .page1 while your page is Page1.
Thanks.
Bibhu.
Views
Replies
Total Likes
Hi,
You can do this by putting some scripts in the change event of the 2nd DropDown list (locations).
var newVal = this.boundItem(xfa.event.newText);
switch (newVal)
{
case "SomeItems in location DropDown":
form1.page1.PhoneField.rawValue = ""; // Clears any previous existing values.
form1.page1.State.rawValue = "The phone number you want to set";
break;
case "SomeItems in location DropDown":
form1.page1.PhoneField.rawValue = "";
form1.page1.State.rawValue = "The phone number you want to set";
break;
default:
break;
}
Thanks.
Bibhu.
Hi Bibhu,
Thanks for the quick response. Unfortunately, I am still not able to get the text field to display properly. I have attached a copy of the form, with the new script already embedded. Please let me know what I am doing wrong.
Thanks,
Ed Watson
Views
Replies
Total Likes
It doesn't look like my attachment went through. Here's the script:
</field
Views
Replies
Total Likes
Hi,
Sorry. I can not see your script. Please upload the form in Acrobat.com and give the link here.
Thanks.
Bibhu.
Views
Replies
Total Likes
Hi,
Here is the link to your form. https://acrobat.com/#d=BaCL7BKKdAcgV3JIk61nZg
You have field mis matches in the change event of 2nd DropDown.
While referencing it you are using .page1 while your page is Page1.
Thanks.
Bibhu.
Views
Replies
Total Likes
Thanks for all your help!
Ed
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies