Can I define a minimum amount of characters that users must write in their User Profile Fields, that is more than 1?
Announcement
Collapse
No announcement yet.
User Profile Fields
Collapse
X
-
Sorry, there is no function to do this. This requires modifying the code. We cannot officially support code modifications or forums running modified code, however you can try searching or asking for help with this over at www.vbulletin.org.Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
-
Originally posted by Steve Machol View PostSorry, there is no function to do this. This requires modifying the code. We cannot officially support code modifications or forums running modified code, however you can try searching or asking for help with this over at www.vbulletin.org.Originally posted by Garamond View PostCan I define a minimum amount of characters that users must write in their User Profile Fields, that is more than 1?
Comment
-
Garamond,
Actually, this can be done with a fairly simple template modification. Last time I checked, nobody gets banned (or loses tech support) for using template mods, so...
In the register template, the form verifies that A) both password fields have been filled out, B) both password fields match, and C) COPPA is not being bypassed. If any of these conditions are false, then it throws up a javascript error. It would be trivially easy to add other verifications and I wish this was a feature of vBulletin.
For example if I wanted to make sure that the e-mail address is at least 5 characters long, I could:
Change:
Code:<form action="register.php?do=addmember" name="register" method="post" onsubmit="return verify_passwords(password, passwordconfirm);">
Code:<form action="register.php?do=addmember" name="register" method="post" onsubmit="return verify_passwords(password, passwordconfirm[B], email[/B]);">
Code:function verify_passwords(password1, password2)
Code:function verify_passwords(password1, password2[B], email[/B])
Code:else if (password1.value != password2.value) { alert('$vbphrase[entered_passwords_do_not_match]'); return false; }
Code:else if (email.length <= 5) { alert('You must enter a valid e-mail address.'); return false; }
Comment
-
Originally posted by Steve Machol View PostSorry, there is no function to do this. This requires modifying the code. We cannot officially support code modifications or forums running modified code, however you can try searching or asking for help with this over at www.vbulletin.org.
If you require the user field to match the regular expression "^.+$" (without quotes), the user must enter at least one character in the field and cannot leave the field blank.
I discovered this inadvertently when upgrading from 3.5 to 3.8.
We had a user field for mobile phone numbers with the regular expression "^[\d\s-]+$" (without quotes) - the effect was that, if the user entered anything in this field, it was required to be a series of numbers, spaces and/or hyphens. If nothing was entered in the field, no attempt was made to match the pattern.
Upon upgrading to 3.8 we discovered that users who edited their profiles were being required to enter a value for this field, whereas previously they were permitted to leave the field blank.
I resolved this by changing the "+" in the regular expression to a "*" so as to allow for empty strings, but it does appear to indicate that users can be forced to enter a minimum number of characters in user fields.
Garamond, as a quick reference guide, try one of these expressions:
.+ means one or more characters (or at least one character)
.{3} means exactly three characters
.{3,10} means between three and ten characters inclusive
.{3,} means at least three characters
I should note that if you were only interested in default user fields (such as email) rather than custom added user fields, this probably doesn't apply.
Comment
-
Originally posted by exegete View PostWith respect, I am not certain that this is correct.Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment