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

Question

Question

Forms 11 update 3: javascript error: Uncaught (in promise) Invalid values

asked on July 14, 2023 Show version history

I am getting this error in the console log: Uncaught (in promise) Invalid values

I am 100% noob to this language. jQuery no prob, but this is a learning curve, so apologies in advance.

 

I have tried these 2 formats and both return the above error.

 LFForm.onFieldChange(function() { LFForm.setFieldValues({fieldId: 16}, null)}, {fieldId: 5});
 LFForm.onFieldChange(function(){ LFForm.setFieldValues({fieldId: 11}, null)}, {fieldId: 5});
 LFForm.onFieldChange(function(){ LFForm.setFieldValues({fieldId: 10}, null)}, {fieldId: 5});
 LFForm.onFieldChange(function(){ LFForm.setFieldValues({fieldId: 6},  null)}, {fieldId: 5});
 LFForm.onFieldChange(function(){ LFForm.setFieldValues({fieldId: 15}, null)}, {fieldId: 5});
LFForm.onFieldChange(function(){ LFForm.setFieldValues({fieldId: 16}, null), LFForm.setFieldValues({fieldId: 11}, null),
LFForm.setFieldValues({fieldId: 10}, null),LFForm.setFieldValues({fieldId: 6}, null),LFForm.setFieldValues({fieldId: 15}, null) },
 {fieldId: 5});

Basically what I am trying to do is clear out fieldsID's: 16,11,10,6,15 on change to fieldId 5. I need to clear out fields that perform a lookup if a radio button's selection has changed. 

I'm not sure which is the better format either. 

Thank you in advance friends!

0 0

Replies

replied on July 16, 2023

Hi, this function with the first format seems work for me. I cannot reproduce the error in the console log. Could you please supply more information about the error? What is the specific filed of fieldId 5 and fieldsID's: 16,11,10,6,15 and what is your Forms version?

0 0
replied on July 17, 2023 Show version history

Thanks for the response!
version: Laserfiche Forms Professional Version 11.0.2307.40547

fieldID 5 is a radio button field:



The other fields are all text types except for fieldID 6, which is a number:

 

Update: I could get the error to stop when I comment out the line for fieldID 6 which is the number. Looks like it does not like 'null' placed in that field. It works if I change it to '0' (zero), which is actual NOT what I want ideally. 

So the question is: how to clear out all values from a number type field using javaScript? 


Thanks!

1 0
replied on July 17, 2023

Thanks for reporting the issue. We have logged it as a bug (ID: 472854), it will be fixed with the next Forms update.

Apologies for the inconvenience.

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

Sign in to reply to this post.