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

Question

Question

lookup rule to match and fill data into same text box.

asked on May 21, 2020 Show version history

Hello All.

I have a requirement where i have to filter search based on the input. I have a textbox where the user enters a value[search]. I have a stored procedure that will take 1 parameter as input [from textbox] and display the result. I want the same textbox to populate the values based on the entered search like dropdown.

The stored procedure is used only to display top 10 results as the number of records is pretty much high in the table. 

 

1. is there a way to accomplish match and fill in the same textbox?

 

2. Is there a way to filter and display top 10 records as suggestions after search. I tried and couldn't find out a solution.

can anyone Help me to solve this ?

 

Thanks,

Lokesh. P

0 0

Replies

replied on May 22, 2020

You should not use the same field for both the matching and the results. This will trigger a loop where it searches, display the result, searches, displays the result, etc.

 

What you can do is fill in all possible values into the single-line field and it will appear as auto-suggestions. When they click in the field, the entire list will appear:

And if they start typing it will filter the list:

 

You could also use a dropdown and add a JS library that allows them to search and filter them, which would function similarly to the suggestions but will force them to select a value.

 

For #2, if your procedure already returns the top 10 then just target a single-line field and it will appear as suggestions as above.

0 0
replied on May 26, 2020

I have been able to use a jquery library called chosen to create a dynamic lookup field for doing lookups and then set the lookup on the form to point to the data source and then not have a condition.  

It was this article:  https://answers.laserfiche.com/questions/73762/How-to-Add-CSS-Class-to-Select-Field#166871 that lead me to doing the dynamic lookup. 

 

For the lookup portion, I found this to work for using a database as a lookup to give a dynamic drop down, type ahead field.

I then end up with a field that will query the database and fill the drop down with that information and then it will type ahead like a search in google would do.

 

0 0
replied on May 27, 2020

That's exactly what I suggested with my "Select2 List" screenshot (though you used a different JS library). Again, it's not doing a dynamic lookup. It queries once and then lets you filter the list.

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

Sign in to reply to this post.