How do I set up a field to automatically populate based on the enter in a previous field? Example: Choose an employee name -- Automatically display manager name. Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
There was nothing wrong with your code. I added a default case for testing so you may want to remove it. In your DDList you can have a value that you display and a value that you sbmit. This is common for DDlists. If you look at the binding tab you will see that the values are not the same. So the rawValue property will give you what is submitted and the formattedValue property will give you what is displayed. I simply modified your code to use the formattedValue and it works. You may want to fix the DDlist becaus eit is still set to submit a numeric value instead of the Name that the user selects.
I have attahend the modified sample
Paul
Views
Replies
Total Likes
Where is the information about the relationship between employee Name and manager name going to come from? Is this informaton stored in a database somewhere? An LDAP server?
Paul
Views
Replies
Total Likes
The info is in an Excel file right now and since it's a relatively small amount of info it's in two unlinked dropdown boxes, in LC. Is there a preferred place to have it or any way to just link the two fields?
Views
Replies
Total Likes
I assume that you want to enter user name into one field and have the Manager field updated to reflect who the user's manager is (is this what you mean by linked).
If so then the information is in that Excel spreadsheet and the form woudl have to interrogate the spreadsheet to get the information. You can make the SS look like a DB and we can connect to it from the form but it will mean that we will have to extend the form to allow Reader users to make the DB call. Acrobat users do not have to worry about this. Also the SS woudl have to be available to every user (so that we can do the lookup) as well we would have to configure a Data Set Name (DSN) on each user machine. So it is possible but if you have a lrge number of users the maintenance can be a pain!
Paul
Views
Replies
Total Likes
Ok, so this is sounding like a lot of work. I could put the data in a DB, that's not an issue. Is it something that even after we'd get it set, someone could access if they're away from the office not directly logged into the computer, just doing something web-based? There's no way to manage the info with LC then?
Views
Replies
Total Likes
You could hard code it into the form or you coudl make a web service to call the data (but th eweb service will havethe same Reader Extensions provisions). Hard coding it in the form woudl mean that the form woudl have to be updated each time the information changes.
Paul
How do I do the hardcoding? It's not that much to update and sounds simpler, or at least more self-contained in the long run.
Views
Replies
Total Likes
There are two coding techniques you can use to do this. Before we get to the coding the technique that will be used is to put code on the exit event of the field where the employee enters their name. The code would check to see what was entered and based on that value will update the Manager field with the correct name. This can be accomplished by using a series of IFstatements or if there are a large number of entries a SWITCH statement might be easier. I created a quick sample to show you how it is done for both.
Paul
I'm getting close to this working, but not quite. I select the name for the Employee Name, but nothing appears in the Supervisor Name field. I've attached a sample of what I'm doing. There are more names involved, but I'm figuring that if I can get a few names to work, I can copy for the others. Thanks so much for your help.
Views
Replies
Total Likes
There was nothing wrong with your code. I added a default case for testing so you may want to remove it. In your DDList you can have a value that you display and a value that you sbmit. This is common for DDlists. If you look at the binding tab you will see that the values are not the same. So the rawValue property will give you what is submitted and the formattedValue property will give you what is displayed. I simply modified your code to use the formattedValue and it works. You may want to fix the DDlist becaus eit is still set to submit a numeric value instead of the Name that the user selects.
I have attahend the modified sample
Paul
Views
Replies
Total Likes
Thank you so much for your help!
Views
Replies
Total Likes
To expand on this, how would one code this example so that if user selects Canada for Field1, Field2 presents a drop-down list of provinces, but if US is selected for Field1 then Field2 populates with states? Is there any way to accomplish this with hard code without resorting to a database? Thank you.
Views
Replies
Total Likes
Under your Designer ES installation you should have a sample file named "Purchase Order.pdf" that contains the drop-down sample you are looking for (Canada / US / Provinces / States).
With my installation it was found under: C:\Program Files (x86)\Adobe\LiveCycle ES\Workbench ES\Designer ES\8.2\EN\Samples\Forms\Purchase Order\Dynamic Interactive\Forms\
And if you have trouble finding it, it's attached to this message.
Views
Replies
Total Likes
Views
Likes
Replies