You are viewing limited content. For full access, please sign in.

Question

Question

Forms 9.2 - Populate Table Drop Down Options with Lookup

asked on November 7, 2014

I have a table that I'm using to capture multiple values to populate multi-value fields in Laserfiche. For each table column, I have a lookup that always is active and pointing to a SQL table that I've generated, which populates the drop-down list options for each column / added row. The one issue I'm running into, is that when using the table and lookup, I can actually type anything I want (something not in the drop-down), which is problematic for consistent input. For instance, we might have users choosing not to use the drop-down options and type something random. 

Does anyone have an idea for limiting the table drop-down options (populated by SQL) as the only usable input and disabling the users ability to type whatever they want in the rows? Using a predefined drop-down list is not an option. 

Or, would it be possible to insert some sort of JQuery that notifies the user that they have entered a value not found in the SQL database? 

 

Capture.JPG
Capture.JPG (23.16 KB)
1 0

Answer

SELECTED ANSWER
replied on November 7, 2014 Show version history

I'm guessing you're currently using Single Line fields? If you change the field type that you put on the form to Drop-down fields, you can restrict the data entry how you are describing. You can still use a Drop-down with a lookup rule. The only functionality you lose is the ability to type in the input box and have the results list filtered down.

If your lookup list is lengthy and you want to keep that 'type-to-filter' behavior, you could definitely do it with single line fields and javascript, but it's more complicated that way. You'd need to search the HTML for the correct option nested below the input box. This should get you started:

$('#qN datalist').find('option[value="YOUR_VALUE"]')
1 0
replied on November 7, 2014 Show version history

Exactly what I needed. Thank you for the nudge in the right direction. 

0 0

Replies

replied on June 26, 2015

Can you elaborate more on how this can be accomplished? This is exactly what I would like to do.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.