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

Question

Question

Issues after recent Forms update

asked on August 25, 2016

Good day,

 

Since we implemented the update recently  we have been experiencing the following issues - 

 

1. If a table in a Form has the Append Rows to the Rows populated option ticked, Field rules applied to those Fileds no longer work. Show/Hide etc has no action even when the rules are met. Once you remove the Append option and set Range of Rows or Set Rows, the Field options work. 

 

2. A javascript that used to run when the Form loaded no longer runs until the user Clicks. The javascript is below. 

$(document).ready(function () {
  
  
$('.cf-table-block').on('change', 'input', PrivateCalc);

function PrivateCalc() {
      
var Fuel = 0; 
var fuelTotal = 0;	
var privateTotal = 0;
			
$('.cf-table-block tbody tr').each(function () {
				
Fuel =  parseNumber($(this).find('.sum input').val()); 	 
		 
$(this).find('.private input:checked').each(function () {
    
if($(this).val() == "Private"){privateTotal += Fuel;}
  
            	});
        		
fuelTotal += Fuel;});
		
		// Populate totals
        $('.total input').val(fuelTotal.toFixed(2));
      	$('.total input').attr('readonly', 'True'); //makes the field read only after we give it a value
      	$('.privateTotal input').val(privateTotal.toFixed(2));
     	$('.privateTotal input').attr('readonly', 'True'); //makes the field read only after we give it a value

    }
  
function parseNumber(n) {
        var f = parseFloat(n); //Convert to float number.
        return isNaN(f) ? 0 : f; //treat invalid input as 0;
    }
});

$(document).ready(function () {
  
$('.cf-table-block').on('change', 'input', receiptCalc);

function receiptCalc() {
      
var Fuel = 0; 
var fuelTotal = 0;	
var privateTotal = 0;
			
$('.cf-table-block tbody tr').each(function () {
				
Fuel =  parseNumber($(this).find('.sum input').val()); 	 
		 
$(this).find('.receipt input:checked').each(function () {
    
if($(this).val() == "No"){privateTotal += Fuel;}
  
            	});
        		
fuelTotal += Fuel;});
		
		// Populate totals
      //  $('.total input').val(fuelTotal.toFixed(2));
      //	$('.total input').attr('readonly', 'True'); //makes the field read only after we give it a value
      	$('.receiptTotal input').val(privateTotal.toFixed(2));
     	$('.receiptTotal input').attr('readonly', 'True'); //makes the field read only after we give it a value

    }
  
function parseNumber(n) {
        var f = parseFloat(n); //Convert to float number.
        return isNaN(f) ? 0 : f; //treat invalid input as 0;
    }
});

Thank you for any assistance

Ian

0 0

Replies

replied on August 25, 2016

I can reproduce the first issue with Forms 10.1 update 2 applied. Please use range of rows as workaround, we will fix for next release.

For second issue, can you give more content? How you design your table? What field types are used? How you fill the values(using lookup rules or default values)? If use lookup rules, how you design the lookup rules? And you expect the change of which field to trigger the script? I can't reproduce by design a form which I guessed what content you may have(http://screencast.com/t/FYQ5WBLXl)

0 0
replied on August 26, 2016 Show version history

Hi Xiuhong,

 

Thanks for the feedback. 

 

With regards to the form design, the form does a lookup based on the users name when they open the form. The table fields populated are a date, location and a currency amount. In addition to these fields, there are also 2 CheckBox fields: Missing Receipt and Private Transaction in the table. 

 

As the form loads a total field outside of the table would calculate and become read only. This no longer runs on load.

 

As the user clicks on the options of Private or Missing Receipt, fields outside of the table calculate for the Missing Receipt Total and Private Total. 

 

At the moment when the user checks the box, the script runs fine but unless a user does this the totals remain empty. It ran on load before the update. 

 

I hope this description helps. I will also post a screenshot 

 

Regards

Ian 

Transaction Form - After check box.PNG
Transaction Form.PNG
0 0
replied on August 30, 2016

Hi Ian, does the JavaScript not run issue happens only when table option is selected "append rows to the rows populated by a data source or variable"? Can you check whether it works if you change the table option to "range of rows"? It should be same root cause as issue 1.

0 0
replied on August 30, 2016

Hi Xiuhong, 

 

I  can confirm that if I change the table to Range of Rows then the Javascript runs as it should. Looks like both issues lie with the Append Rows option.

 

Regards

Ian

0 0
replied on August 30, 2016

Please use "Range of Rows" as workaround, we will fix the issue for Append Rows in next release.

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

Sign in to reply to this post.