MyBB Community Forums

Full Version: Preventing space character on Usercp
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello

How can we prevent members to enter only "space" character to any profile field on user control panel/Edit Profile?

Thanks.
what will that change?
Ugh..then how will they enter a two word occupation like "mcdonalds manager"?
I don't see why on the entire usercp edit you don't want spaces.
I think I can't explain.

I don't want the members can enter ONLY " ".
They can enter space between two words of course.
They can't enter ONLY one space character ALONE.
For all the required parts of the usercp then?
CraKteR Wrote:For all the required parts of the usercp then?

for "Additional Information", "Additional Contact Information", "Custom User Title" and "Optional Fields".
Do you mean to make them required so they are not blank? You can do that in the admincp.
labrocca Wrote:Do you mean to make them required so they are not blank? You can do that in the admincp.
I think that's what he means because you pass some of the required fields just by inputing a space.
In inc/datahandlers/user.php, find:
		$msn = &$this->data['msn'];
After that, add:
		$msn = trim($msn);

You can do similar things with icq, website, etc...
Guys but those fields show on the profile even if they have a value or not, same for custom profile fields. So what's the sake behind preventing only a space if the field will always show up empty?

Btw when adding msn and such there is a check, only a space will already give an error saying not valid email.
Pages: 1 2