JS problem related to message field
-
Hi, your plugin is excellent. I enjoyed using it. However, there’s a problem related to the message field. When a user presses Enter key to go new line which is common in these types of fields, and then clicks on send button, a JS error appears, which prevents the form from being submitted and sent to WhatsApp.
It says:VM8330:1 Uncaught (in promise) SyntaxError: Unexpected token in JSON at position 99 at JSON.parse (<anonymous>) at HTMLFormElement.handleSubmit (frontend.js:63:30) at HTMLDocument.dispatch (jquery.min.js?ver=3.6.0:2:43064) at v.handle (jquery.min.js?ver=3.6.0:2:41048)
the line 63 is :
const form_data = JSON.parse('{"' + decodeURI(form_serialized_data).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
I have another issue with your product. I want to remove email from the form. I use the filter you provided, and it successfully deletes the email field from the form, but in Whatsapp, it still exists. I tried to change the array for setting in the class.app.php file and changed the value of defined_preset but nothing happened. In addition, please add an option to localize and translate WhatsApp preset.
- The topic ‘JS problem related to message field’ is closed to new replies.