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

Question

Question

Using Process Error message

asked on April 23, 2019

How do I use process error message to display an error in a number field if the value is more than $1000 please? Thanks

 

Priya

0 0

Replies

replied on April 23, 2019

First you need to make sure you're using a numeric field type (number, currency, etc.)

Next, in the field configuration, set a minimum and max value (1000)

Lastly, if you want a custom message other than "out of range" you add a rule, type your message, select "value exceeds maximum" or "value out of range" and choose the fields.

If you do a "process" error message, it has to be based on label, type, etc., but if you do a error message on the form itself you can choose the specific field.

0 0
replied on April 30, 2019

Thanks. But Currency field does not allow me to put a maximum. Please help. Thanks.

 

Priya

0 0
replied on April 30, 2019

Add a custom CSS class to your currency field called "limitedCurrency" and then add the following JavaScript.

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

Or, you can just get the ID of the field and change the JQuery selector to use that instead of the class/type.

1 0
replied on April 30, 2019

Thanks

0 0
replied on June 17, 2019

I have a table prepoulated with existing rows. If I change the currency in those rows, the validation triggers. But, if I add a new row to the table and populate currency, it does not trigger validation. Any help please?

 

Thanks

Priya

0 0
replied on June 17, 2019

You're event handler is probably being assigned when the form first loads. The rows are added after, so they didn't get the event handler.

You have to use delegated event handlers to make sure they fire on rows that didn't exist when the form loaded.

Basically,

  1. Form loads
  2. Event handlers are assigned to your pre-populated rows
  3. Lookup adds new rows (these have no handler)

 

A delegated handler will monitor the table for changes, then fire when changes occur on your target fields so you don't have to worry about "new" rows.

https://answers.laserfiche.com/questions/153832/Table-and-Collection-JavaScript-Event-Handlers

0 0
replied on June 17, 2019

Thanks

0 0
replied on June 17, 2019

I am using out of the box Error messages feature. I am just assigning the max value of currency field using CSS class as below:

$('.otm input').attr('max',5000);    
  

Is there a way to do this with out of the box please?

 

Priya

 

0 0
replied on June 17, 2019

You would need to attach an event handler to the lookupcomplete event.

If you add the max value when the form loads it works on the existing rows, but lookups create new rows that won't have those customizations.

0 0
replied on June 17, 2019

Ok. So, do I do something like below please?

 

 $('.MyTable').on('change',function(e){

   $('.otm input').attr('max',5000);   

  });

 

0 0
replied on June 17, 2019

I wouldn't do that. That event is going to fire on every single change so it would be triggered by field value changes and run a lot more than you want it to.

Check this post instead

https://answers.laserfiche.com/questions/108471/Can-we-get-a-lookups-complete-custom-event-listener-please#121241

0 0
replied on June 17, 2019

Thanks

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

Sign in to reply to this post.