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

Question

Question

Please Enter Integer into field Error

asked on May 27, 2016

The number fields I am using only the one field is returning the error.

 

$(document).ready(function () {
    $('.cf-collection-block').on('blur', 'input', sumtotal);
    $('.subtotal').on('blur', 'input', sumtotal)
    $('.quantity').on('blur', 'input', sumtotal);
    function sumtotal() {
        var sum = 0;
        $('.cf-collection-block ul').each(function () {
            var s = 0;
            s = (parseNumber($(this).find('.price input').val()) *1.085* parseNumber($(this).find('.quantity input').val()));
            $(this).find('.subtotal input').val(s.toFixed(2));
            sum += s;
            
        });
        $('.total input').val(sum.toFixed(2));
    }
    function parseNumber(n) {
        var f = parseFloat(n); //Convert to float number.
        return isNaN(f) ? 0 : f; //treat invalid input as 0;
    }
});

As far as the calculations go, it's working perfectly.  I am just not sure why it's wanting an Integer while the Quantity seems to be fine.

0 0

Answer

SELECTED ANSWER
replied on June 3, 2016

Where does the value of price come from,  filled by user or lookup rule or forms calculation?  We can't reproduce this issue using similar form and JavaScript. Can you open a support case with exported business process xml?

1 0

Replies

replied on May 28, 2016

Chase,

It looks like you are missing the terminator ; at the end of the .subtotal line.

 

Wes

 

0 0
replied on May 31, 2016

Added the terminator, surprising it worked without it.  But it's still functioning with the same warning as shown in the picture above.

1 0
replied on May 29, 2016

Hi Chase,

Is number of decimal places set as 0 for price field? If it is 0, try to change it to 2.

0 0
replied on May 31, 2016

They are all set to 2 as well as unchecked Number Display.

0 0
SELECTED ANSWER
replied on June 3, 2016

Where does the value of price come from,  filled by user or lookup rule or forms calculation?  We can't reproduce this issue using similar form and JavaScript. Can you open a support case with exported business process xml?

1 0
replied on June 14, 2016

Price is pulled in by a lookup to a custom SQL table.

 

Ill open a case.  Thanks.

0 0
replied on June 14, 2016

I was just able to reproduce this error with a trailing space at the end of the price value. Might want to make sure that the value coming back from SQL is trimmed.

To reproduce the error simply enter a number in any number field and press the space bar.

0 0
replied on June 14, 2016

Sorry actually in this example the Price is manually entered in the Form Field.

The only feature affecting this field would be the Javascript.

0 0
replied on June 14, 2016

A Support Case was opened for this issue. Per Chase's comments in the case notes:

"I imported the XML as a new copy and found it didn't save the changes to the Field Price for 2 decimal places. I modified again on all the forms and tested. It is finally acting at a float value now and not an integer."

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

Sign in to reply to this post.