Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 04 Dec 2012, 10:44
vithorius's Avatar
vithorius vithorius is offline
 
Join Date: Feb 2008
Question How to force users to insert at least X characters into a given custom profile filed?

Does anybody knows how to force users to insert at least X characters into a given custom profile filed?

In the user's custom profile field 'Location' (city), I would like to force users to, at least, insert 3 (three) characters.

I've already searched through hacks here in vb.org, but found none... How to do it?

Thank you!
Reply With Quote
  #2  
Old 04 Dec 2012, 13:37
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You can create a plugin using hook location register_addmember_process and code like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Then you also need to create a phrase with the error message you want (set Phrase Type to "Error Message"), and replace 'phrasename' with the name of your phrase.

Last edited by kh99; 04 Dec 2012 at 13:38. Reason: fixed a couple typos in code
Reply With Quote
  #3  
Old 04 Dec 2012, 20:47
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Can't you use the regex field and enter something like:
.{3,}
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #4  
Old 04 Dec 2012, 21:05
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You can - I don't think I ever noticed that before. And it works, the only thing is that it only tells you that the value is "missing or invalid". But if you also edit the description to say that it has to be 3 or more chars, that works pretty well, with no plugins.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 10:56.

Layout Options | Width: Wide Color: