Hello, I am using the following JS code to clear my field when the form is submitted because i the field contains invalid input.
LFForm.onFormSubmission(function () {
var fieldsToClear = LFForm.findFieldsByClassName("clearThisField");
LFForm.setFieldValues(fieldsToClear, "");
});
I cant get rid of this field because i need the content in the process. Using this code when I hit submit it clears the field but gives me an error and then when i hit submit the second time it submits the form because this time the field has already been cleared. What can I do for all this to happen in just one time?
Thank you for helping