Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Minimum Characters in Custom Profile
#1
Not Solved
Can I set a minimum amount of characters in a Custom Profile field, I cannot seem to find a minimum, there is a maximum, but no minimum
#2
Not Solved
Go to ACP>>Templates & Styles>>Templates>>Your Template>>User Control Panel Templates>>usercp_profile_customtitle

Find:
<td><input type="text" class="textbox" name="usertitle" size="25" maxlength="{$mybb->settings['customtitlemaxlength']}" value="{$newtitle}" /></td>

and replace with:
<td><input type="text" class="textbox" name="usertitle" size="25" minlength="5" maxlength="{$mybb->settings['customtitlemaxlength']}" value="{$newtitle}" /></td>

Modify this according to your needs: minlength="5"
#3
Not Solved
Thanks for your reply, but wont that set a minimum for them all?? I only want a minimum for 1 of the 3 that I have just created
#4
Not Solved
Anyone else?
#5
Not Solved
No it will only set the minimum value to that particular line which is customtitle
#6
Not Solved
Ok im slightly confused now.

I have created 2 new fields for my registration, (Im guessing you call these custom profile fields?)

I want a minimum on both of them, but a different minimum amount. here is the code as per FireBug

<input id="fid1" type="text" class="textbox" name="profile_fields[fid1] size="0" maxlength="8" value=""">

<input id="fid4" type="text" class="textbox" name="profile_fields[fid4] size="0" maxlength="30" value=""">

Now if I change the
ACP>>Templates & Styles>>Templates>>Your Template>>User Control Panel Templates>>usercp_profile_customtitle

From:
<td><input type="text" class="textbox" name="usertitle" size="25" maxlength="{$mybb->settings['customtitlemaxlength']}" value="{$newtitle}" /></td>

to:
<td><input type="text" class="textbox" name="usertitle" size="25" minlength="5" maxlength="{$mybb->settings['customtitlemaxlength']}" value="{$newtitle}" /></td>

then surely it will add a minimum length, with that minimum length being the same on both?
#7
Not Solved
Just add minlength="your minimum value"
#8
Not Solved
(2013-09-19, 12:06 PM)marcus123 Wrote: Just add minlength="your minimum value"

how does that work when mybb loops through the custom user fields array ? the OP needs different minimum length value for each field not just a fixed minimum length ... the answer is perhaps a small plugin to add the value when mybb loops
Not in this land alone,
But be God's mercies known,
From shore to shore!
Lord make the nations see,
That men should brothers be,
And form one family,
The wide world ov'er

#9
Not Solved
Yea I did try marcus but it didnt work, I put min lengh as 10 and it still allowed me to register with 3 characters.


Forum Jump:


Users browsing this thread: 1 Guest(s)