Hello! I need to catch if someone just tries to enter a space in a required field, and still give them "field is required " alert. I can't get the script to work, instead of replacing only spaces, it replaces the entire string:
fld = document.getElementById('DM');
var re =/\\s/g;
RegExp.multiline = true; // IE support
fld = (fld.value).replace(re,"");
Can someone please help? :shifty:thank you!