Skip to Content Skip to Menu

username character restriction request $$

  • mediaguru
  • mediaguru
  • OFFLINE
  • Posts: 365
  • Thanks: 1
  • Karma: 70
16 years 9 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 or Create an account to join the conversation.

  • mediaguru
  • mediaguru
  • OFFLINE
  • Posts: 365
  • Thanks: 1
  • Karma: 70
16 years 9 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 or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
16 years 9 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 or Create an account to join the conversation.

  • micheleq
  • micheleq
  • OFFLINE
  • Posts: 144
  • Thanks: 22
  • Karma: 6
16 years 9 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 or Create an account to join the conversation.

  • mediaguru
  • mediaguru
  • OFFLINE
  • Posts: 365
  • Thanks: 1
  • Karma: 70
16 years 9 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum