Skip to main content
Shwaffle11
Participant
February 1, 2018
Question

Partial drop down search giving unexpected results

  • February 1, 2018
  • 1 reply
  • 1075 views

I have a drop down that is being populated dynamically: https://i.imgur.com/QKohGq5.png

Users have the ability to do a partial search of the drop down, to filter down to what they're looking to find: https://i.imgur.com/S0P3T17.png

However, when selecting one of the options from within the remaining options available, the results are not always as intended. In this case, I will search "Adult B" to choose Adult Brass Dragon. When selecting Adult Brass Dragon, the following script is enacted:

applyMonster(event.value, 0);

This should be choosing the option I chose, and passing it through my scripts to fill the rest of the form with information. Nothing else manipulates this drop down, aside from choosing the manual that needs to be chosen beforehand.

This is what has happened when I selected Adult Black Dragon: https://i.imgur.com/3q7IJ6T.png

I have searched and searched, but have not found anything regarding this issue, and it's starting to drive me a little crazy. It seems to be choosing another random option beginning with A, regardless of what I choose.

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
February 1, 2018

Before the line

applyMonster(event.value, 0);

add following line

console.println("value " + event.value);

Then you can see in the console what was selected.

Participant
February 1, 2018

Here's a quick clip at what is happening: 2018-02-01 11-35-43 on Vimeo

This very much feels like a bug with partial searches, as selecting something from the drop down has no issue.

try67
Community Expert
Community Expert
February 1, 2018

More than happy to share the file, just didn't seem like it's the code causing the problem.

5e Encounter Sheet - Dev.pdf - Google Drive

Edit - Strange...I seemed to have had an Adobe account already registered with my email, but also made one under Google sign-in.


Step #1 when developing code is to enable the option (under Edit - Preferences - JavaScript) to show the JS Console on errors and warnings. As soon as I click into "Monster1.Name", an error message appears, which tells me there are all kinds of issues with it.