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

Question

Question

Use Custom HTML or JavaScript to query SQL and display results on a form

asked on June 16, 2014 Show version history

 

 

Since it's not possible to use 'Lookup Rules' to fill multiple results to a table or collection is it possible to use a custom HTML or JavaScrupt to run a lookup based on a variable input and then output the results in a list so for the user to reference while they fill in the form.

0 0

Answer

APPROVED ANSWER
replied on June 16, 2014

Hi Stephen,

 

You might want to consider using hidden fields to accomplish this.  If you run a query that returns results to fields hidden from the user, you could have a simple JavaScript that copies those values to a the appropriate parts of a table or collection.  From the user's perspective, it would be a completely invisible, seamless solution.

 

As for running your query via JavaScript or HTML, I don't think either of those are options.  The JavaScript is executed clientside, so it won't have access to the database, and HTML just doesn't have query capabilities.

0 0
replied on August 20, 2015

Hi Brett,

 

I know this is from a couple months back but how would you set up the Lookup Rule to return multiple values to hidden fields? This would work great for a project I am working on but when I use lookup criteria with multiple results in the database, the lookup does not return any results.

Or is there some other way to query a database from Forms?

0 0

Replies

replied on June 17, 2014

We accomplished something similar using an Iframe and embedding a php page to do the sql lookup and display.

 

It is not a single action, and requires additional configuration, but it works well and keeps database authentication information from being visible in the client.

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

Sign in to reply to this post.