nachoman316 Posted May 21, 2009 Share Posted May 21, 2009 Hello guys I am new to forums and i'm looking for some advice. I have an email form which posts information to a client which works fine, I have javascript validation and php validation in place but.... When someone enters only whitespace with the space bar in the form input fields instead of flagging up an error it sends a blank form to my client. Any advice on how to tackle this problem would be gratefully received. Thanks again Nacho. Link to comment https://forums.phpfreaks.com/topic/159106-email-input-form-whitespace/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 21, 2009 Share Posted May 21, 2009 You might want to use trim to remove entries that are all whitespace before you validate that a field is not empty. Link to comment https://forums.phpfreaks.com/topic/159106-email-input-form-whitespace/#findComment-839087 Share on other sites More sharing options...
nachoman316 Posted May 21, 2009 Author Share Posted May 21, 2009 Thanks for the quick reply you guys are fast lol. is this how I would do it: trim('$name','$email','telephone','enquiry'); Once again thanks for the speedy reply. Nacho. Link to comment https://forums.phpfreaks.com/topic/159106-email-input-form-whitespace/#findComment-839090 Share on other sites More sharing options...
PFMaBiSmAd Posted May 21, 2009 Share Posted May 21, 2009 The light-blue trim is a link that will take you to the manual page for that function where there are working examples of how to use it. Link to comment https://forums.phpfreaks.com/topic/159106-email-input-form-whitespace/#findComment-839097 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.