username character restriction request $$

16 years 4 months ago #54036 by mediaguru
I've got a job posted at joomlancers for this request. Or if someone here has the skills I'd be willing to pay a few bucks for this.

I've been wasting a lot of my personal time with my very limited php abilities. I've found javascript which will restrict the characters and size for a form field, but implementing it into CB is beyond my abilities now.

The goal:

Restrict username field length.
Not allow spaces in username.
Only allow text and numbers in username, no other characters.

Bad username: "fred smith" or "fred@mail.com"
Good username: "fredsmith"

I think a CB plug would be best for this, with a back end which allows one to configure the username length.

Ultimately this would be nice as a built in CB function.

CB/Joomla golf site: www.thegolfspace.com
Geek/joomla site: www.tkserver.com

Check out my Joomla/CB projects:

* LIKE thumbs up system for "liking" content items
* Karma - CB user rating system
* Golf Score Tracker
* Jitter - status update system. "What's on your mind?"
* CB Author Plug - Shows CB author link and avatar in content items. J1.5 compatible and very customizable!

Found on my web site or in the Joomlapolis Directory !

Please Log in to join the conversation.

16 years 4 months ago #54191 by mediaguru
Replied by mediaguru on topic Re:username character restriction request $$
I've been blown away by the responses....

Necessity is the mother of invention.

I hacked cb and now have achieved this vor now. No my new registrations can't have any characters other than alphabet and numbers...

CB/Joomla golf site: www.thegolfspace.com
Geek/joomla site: www.tkserver.com

Check out my Joomla/CB projects:

* LIKE thumbs up system for "liking" content items
* Karma - CB user rating system
* Golf Score Tracker
* Jitter - status update system. "What's on your mind?"
* CB Author Plug - Shows CB author link and avatar in content items. J1.5 compatible and very customizable!

Found on my web site or in the Joomlapolis Directory !

Please Log in to join the conversation.

16 years 4 months ago #54204 by beat
You work faster than we can reply :D

Cool. Don't forget to share how you did that, so that others (or yourself too) can find the how to next time they (you) need it ;)

For now, CB follows automatically the rules of the CMS version on which it sits. We are improving things for this kind of things to be easy to configure, but it is not done yet. :)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

16 years 3 months ago #56159 by micheleq
Replied by micheleq on topic Re:username character restriction request $$
What is your solution to limiting the username length?

Please Log in to join the conversation.

16 years 3 months ago #56180 by mediaguru
Replied by mediaguru on topic Re:username character restriction request $$
I created a little javascript which only allows numbers and letters in the username field. If they type in something else, or even a space, a popup comes up and tells them they need to redo it and it wipes out the text they put in the field.

I'm no pro. I did an "onkeyup" to trigger the javascript so I had to disable username checking which also works on key up.

I also put maxlength="16" in there to restrict the username to 16 characters.

Attached is a .zip file of my cb.core.php file which has everything working.

You can see it in action on the registration page of www.thegolfspace.com or www.themacspace.com

Attachment cb-5f11c86338d621bbb0790e6223e69c7f.zip not found


CB/Joomla golf site: www.thegolfspace.com
Geek/joomla site: www.tkserver.com

Check out my Joomla/CB projects:

* LIKE thumbs up system for "liking" content items
* Karma - CB user rating system
* Golf Score Tracker
* Jitter - status update system. "What's on your mind?"
* CB Author Plug - Shows CB author link and avatar in content items. J1.5 compatible and very customizable!

Found on my web site or in the Joomlapolis Directory !
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.218 seconds

Facebook Twitter LinkedIn