asked on July 29, 2019

Hi,

I have been trying to use Javascript to fill a table with pre-filled data, depending on a drop-down choice (templates). My table has a GL Number column and a Description column that are requested to be pre-filled when a template is selected. 

Templates are stored within a DB and I use a look up rule to populate the table. Although The GL Number may need to be changed or additional rows sometimes are required in addition to the template. I have another lookup rule that loads the GL Number column with other GL Numbers in case these are required to be changed. 

The issue I keep running into is when I have the lookup rule run after a template is selected, I have the table rows filled but immediately after the text is cleared. I have tried making a hidden table that stores the pre-filled data then use JS to copy it over to the main visible table but still the text is cleared. I have also tried using the 'lookupcomplete' event listener but I still get the text cleared. No matter what, the text is always cleared. Although, if I use JS to freely just add text to the GL Number column (without adding or deleting rows) the field is filled with the text and it is not erased (this does not work when I am copying over the code from the secondary hidden table). 

Is there a way I am able to pre-fill the table with pre-selected text from the lookup rule? Or is there any other way I am able to disable the lookup rule? I have found a thread on here about turning off the autocomplete but that did not disable the Lookup rule. 

 

I am using LF Forms 10.4 as well.

 

Thank you very much.

James

0 0