Here is one of the examples how to use JavaScript in Editable Prepare tab of your ContentBuilder. This example shows how to prevent upload of files with special characters.
How to prevent users to upload files which contains special characters?
You can try to apply following script. Put the script in the Editable Prepare of your view:
echo'
<script>
jQuery(document).ready(function () {
jQuery(".cbToolBar button").click(function () {
var filename = jQuery(".cbUploadField input").val();
if (/[^a-z0-9]/gi.test(filename)) { // anything but a-zA-Z0-9 - add other permitted characters to suit
alert(filename + " contains invalid character(s)");
}
});
});
</script>
';