Javascript on selecting from a dropdown list

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
claude vidal
User
Posts: 138
Joined: Wed Mar 09, 2016 12:47 am

Javascript on selecting from a dropdown list

Post by claude vidal »

What is the trigger for a selection from a dropdown list?

I'm trying to set values other fields on that form based on what was selected from a given dropdown list.

I've assigned a Javascript to that dropdown field on every trigger available (Mouse: down, up, enter, leave, focus, blur); Javascript console active. Nothing triggers.

What do I need to do?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Javascript on selecting from a dropdown list

Post by Tracker Supp-Stefan »

Hello Claude Vidal,

You will need to put the JS in "Keystroke Action":
Keystroke.png
Keystroke.png (13.63 KiB) Viewed 767 times
And the code I am using in one of my salmes looks something like:

Code: Select all

if (event.willCommit) 	
{
this.getField("SomeOtherFieldName").value = event.value + "your custom value";
}
Post Reply