Preventing certain characters in sys_editbox (ie. newline)

Is there anyway to prevent certain characters (such as the newline) to be entered in the sys_editbox field? I know through safari that I am able to insert various characters that really shouldn’t be allowed. I also know that I can run a validation rule for each field in each content type that has a sys_editbox field type, but this seems impractical (in one place as opposed to 100+) as this issue should be resolved by the sys_editbox code (ie. escape special characters).

There is a way, but it’s a little complicated.

You can create an “Input Translation” extension (in Java). This input translation can modify the incoming values from the editbox, and you can remove or escape characters as you wish.

You can attach your extension to the control definition. Make a copy of the sys_editbox control (in sys_templates.xsl) and add it to rx_templates.xsl.

In the Dependencies section, list your new extension. Look at the sys_XdTextCleanup extension (on the sys_EditLive control) for an example of how to do this.

Thanks, I’ll look into it this way.