Hi,
Quite a while back some nice person on this forum gave me the following script to prevent someone entering spaces in a form field that's required. It seems to work fine for me when I fill in the field with spaces and click submit, it gives the error message saying to fill in the required field.
But for some reason I'm getting emails coming through where nothing is filled in and I can't figure out why. Here's what I have:
Note: (redirect(frm) is another function that determines the action tag based on user input)
Thanks for any suggestions.
Quite a while back some nice person on this forum gave me the following script to prevent someone entering spaces in a form field that's required. It seems to work fine for me when I fill in the field with spaces and click submit, it gives the error message saying to fill in the required field.
But for some reason I'm getting emails coming through where nothing is filled in and I can't figure out why. Here's what I have:
Code:
function stripSpaces(frm) {
var x = frm.name.value;
frm.name.value = (x.replace(/^\W+/,'')).replace(/\W+$/,'');
var z = frm.avail.value;
frm.avail.value = (z.replace(/^\W+/,'')).replace(/\W+$/,'');
redirect(frm);
}
Thanks for any suggestions.