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

Question

Question

Maximum Currency Value using Javascript

asked on January 22, 2019

Hey Everyone,

I'm sure that there is someone out there that can help me out with this JavaScript.  I have forms 10.2 and I am looking to set a maximum value of up to, and including $1000.00 on currency field.  All the other questions here seem to only deal with currency calculations.  

 

Thanks!

Drew

0 0

Replies

replied on January 23, 2019 Show version history

You can set a max value for the currency field with minimal JavaScript/JQuery.

As an example,

$(document).ready(function(){
  $('.currencyField input').attr('max',1000);
});

You can use whatever custom class name you want, or you can use IDs instead. You can get the id from the CSS/JavaScript tab (the field ID is "Field" plus the number after "q").

For example, you could use $('#q137 input') or $('#Field137') to target the field below.

1 0
replied on January 24, 2019 Show version history

Hey Jason,

You rock! This is exactly what I was looking for!

 

Drew

0 0
replied on January 22, 2019

Can you use the number field instead? I find currency field just gets in the way since number also supports commas and digits after decimal. Then you can use the built in max.

0 0
replied on January 22, 2019

Hey John, 

I could do that but I already have the form built and styled and don't necessarily want to make that switch if I don't have too. 

 

Drew 

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

Sign in to reply to this post.