Crocoblock / jetformbuilder

79 stars 16 forks source link

Input filters for text fields and text areas #285

Open Pixcil opened 1 year ago

Pixcil commented 1 year ago

It would be great to have a few filters in place with specific actions:

  1. Remove any HTML or other code from input text upon form submission. Sanitizing. This includes anything within HTML tags such as images, links, script code and more.

  2. Banned words - have an option (maybe a JFB global field in settings?) for banned words. Give the ability for the form to sanitize these through either deleting them all together or replacing them with **** for example. Important feature for sites that may be accessed by children.

Pixcil commented 1 year ago

I have found this code here which would be great to be implemented to sanitize text and text area fields; a toggle-able option (in case the user allows for code to be inserted):

https://developer.wordpress.org/reference/functions/sanitize_textarea_field/