Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Username character limit and restrictions

  • mediaguru
  • mediaguru
  • OFFLINE
  • Posts: 365
  • Thanks: 1
  • Karma: 70
16 years 10 months ago #56181 by mediaguru
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. (components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php)

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

This is a hack for cb 1.1 and NOT any earlier version. When a new version comes out, this would be wiped out by the upgrade so you'd have to put the code in again...

I make no guarantees but it works on my sites.

Attachment cb-7d9ce577111522b3ed578044c73ea6f8.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.

  • montana
  • montana
  • OFFLINE
  • Posts: 41
  • Thanks: 0
  • Karma: 1
16 years 10 months ago #56380 by montana
Replied by montana on topic Re:Username character limit and restrictions
nice! This is one of the important function that i need!

I replaced the file a my livesite, i have now (16 characters max):)

but the javascript do denie empty space does not work :(

when i go to your sites and test,it works.
how can i solve this??

Please Log in or Create an account to join the conversation.

  • ferrit
  • ferrit
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
16 years 10 months ago #56887 by ferrit
superb!
attached hack disable spaces and non-english character only in firefox.
On www.thegolfspace.com limitation enable in all brousers - it is cool to see this modification.

Please Log in or Create an account to join the conversation.

  • mediaguru
  • mediaguru
  • OFFLINE
  • Posts: 365
  • Thanks: 1
  • Karma: 70
16 years 10 months ago #56925 by mediaguru
Replied by mediaguru on topic Re:Username character limit and restrictions
Are you guys saying that it doesn't work in IE, yet on my site it does work on FF and IE?

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.

  • montana
  • montana
  • OFFLINE
  • Posts: 41
  • Thanks: 0
  • Karma: 1
16 years 10 months ago #57045 by montana
Replied by montana on topic Re:Username character limit and restrictions
Yes, it doesn't work in IE by my site,but it works on FF

On your site it does work on FF and IE! how comes?

Please Log in or Create an account to join the conversation.

  • ferrit
  • ferrit
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
16 years 10 months ago #57067 by ferrit
mediaguru wrote:

Are you guys saying that it doesn't work in IE, yet on my site it does work on FF and IE?


Yes, in other sites work only in FF.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum