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

Question

Question

modern forms currency field adjustment

asked on July 12, 2023 Show version history

I am developing an AP process for a customer where certain fields, such as line tax, are calculated and may be subject to slight rounding errors that need to be adjusted.  When using the adjustment arrows on the side of the currency field it increases or decreases by $1.  Is there a way to update this so that it adjusts by the cent (+-0.01)?  I have tested with a number field set to 2 decimal places as well and its behavior is the same.

 

 >>>> 

0 0

Replies

replied on July 12, 2023

There is an attribute of the input element called "step" that controls this.  You can see this behavior by using the browser inspect element functionality to edit this value on the input element.  It starts as step="any" and if you change it to things like step="5" or step="0.01" you can see that behavior changing.  What you would need for your desired behavior is for step="0.01" to be the setting.

Unfortunately, that change isn't currently possible in the Forms Layout Designer (as of Forms 11 Update 3).  The Forms Layout Designer does not include a setting to configure the step value and it cannot be changed via Javascript because that setting is not one that has been included in the LFForm Object's changeFieldSettings interface, and the Javascript cannot directly manipulate field elements.

This would be a nice thing to be able to control, so hopefully Laserfiche adds this to the list of functions that can be managed in the future by a configuration on the field or via the LFForm Object's changeFieldSettings interface (I'm tagging @████████and @████████to hopefully consider that addition).  But until that happens, this is not going to be possible in the Forms Layout Designer.

If it's a big problem for your process, here is some CSS to hide the buttons within the field.  If you add this to your form, if will hide it on any field with the CSS Class of hideNumberScroll. 

.hideNumberScroll input::-webkit-outer-spin-button,
.hideNumberScroll input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

 

1 0
replied on July 12, 2023

The increment controls are more of a browser/html feature than a Forms feature. In some cases, the increment amount can be adjusted by setting the "step" attribute on the html input field.

However, as Matthew mentioned, this cannot currently be changed in the modern designer because there's no built-in option and JavaScript can't modify the page elements.

I've also found the behavior with regard to the "step" attribute to be somewhat inconsistent/unreliable across different browsers although it has gotten better over the years.

1 0
replied on July 14, 2023

Thanks for the response!  Since it is something that shows up on these fields automatically in the modern form designer it would be nice to have some control over it, either through scripting or form field controls.

 

 

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

Sign in to reply to this post.