Stop showing error message when using JavaScript to change field value to empty - is this possible?
I have a contact form embedded on a wordpress site that has several fields on it that I want to pre-populate (name, email, company etc), but also a "message" field that I want to load empty each time as each form submission have a new message.
I have set the form to prepopulate, then am using JS to change the value of this one field:
$('textarea[name="message"]').val('').change();
This works and the form loads empty, however as the field has been "edited", the default bevaviour on mobile seems to be to display the "Please complete this required field" error message. (note: this also happens on desktop if I click the "not you" link to reset the form).
This would be expected behaviour if a user edited a required field and left it blank, but it is not the desired behaviour when the field value is change via code like this.
Is there any javascript that can be used (or any other method) that can change the text of the field to empty but not display this error mesage?