Copy link to clipboard
Copied
Hi,
Is there anyway of Aligning text in a dropdown box such as the below,
I can do this by putting spaces in but as different letters have different character widths
its never going to be exact, but our ex-military customer wants it exact and there are 30 in the list.
Any help appreciated
Paul
BDM Business Development Managers
CFIN Central Finance
CLR Client Relations
Copy link to clipboard
Copied
The script will overwrite the current values in your field.
Another thing you can do is attach it to the Mouse Up event of a button field and then click that button.
When done, hide the field so that the code is still embedded in the file and can be used later on, in case the list needs to be changed.
Copy link to clipboard
Copied
It can only be done using tabs, which requires using a script. Execute this code from the JS Console and it should work:
var items = [
"BDM\t\tBusiness Development Managers",
"CFIN\t\tCentral Finance",
"CLR\t\tClient Relations"
];
this.getField("Dropdown1").setItems(items);
Copy link to clipboard
Copied
Hi,
Thanks for the reply, I've typed this all out but not really sure where to run this from.
thanks again
Copy link to clipboard
Copied
From the JS Console. Press Ctrl+J to open it, paste the code into it, select all of it with the mouse/keyboard and then press Ctrl+Enter to run it.
Copy link to clipboard
Copied
Apologies for the questions, but do I take the text with spaces out of the dropdown field I had already created so the java script populates the field, or leave it, also does the script go in the bottom window of the console as this seems to be the only place I can paste it.
I've tied running it a couple of time but nothing seems to happen and there's no errors coming up.
thanks again
Paul
Copy link to clipboard
Copied
The script will overwrite the current values in your field.
Another thing you can do is attach it to the Mouse Up event of a button field and then click that button.
When done, hide the field so that the code is still embedded in the file and can be used later on, in case the list needs to be changed.
Copy link to clipboard
Copied
Thanks for your help, managed to sort it
Paul
Copy link to clipboard
Copied
I would place it as a document level function so that if I needed to change the drop list I would have the code within the form.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more