Javascript on selecting from a dropdown list

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

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

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

Javascript on selecting from a dropdown list

Post by claude vidal » Sat Nov 03, 2018 6:58 pm

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: 13548
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Javascript on selecting from a dropdown list

Post by Tracker Supp-Stefan » Mon Nov 05, 2018 10:39 am

Hello Claude Vidal,

You will need to put the JS in "Keystroke Action":
Keystroke.png
Keystroke.png (13.63 KiB) Viewed 240 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