The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Limit characters for nicknames

View previous topic View next topic Go down

Limit characters for nicknames

Post by dudi on November 13th 2011, 3:15 pm

Is there a way to limit characters only to a-z and numbers and few other marks like . [ ] | ?

dudi
Forumember

Male Posts : 104
Reputation : 30
Language : English

Back to top Go down

Re: Limit characters for nicknames

Post by Guest on November 13th 2011, 3:22 pm

Do you use phpBB2? Smile

Guest
Guest


Back to top Go down

Re: Limit characters for nicknames

Post by dudi on November 13th 2011, 3:31 pm

Yes Smile

dudi
Forumember

Male Posts : 104
Reputation : 30
Language : English

Back to top Go down

Re: Limit characters for nicknames

Post by Guest on November 14th 2011, 11:26 pm

Add this code in your JavaScript management:
Code:
var regx_chr = /^([A-Za-z\[\]\?\|\.]+)$/;

function checkForm() {
  var inpbox = document.getElementsByClassName('post').value;
  if(inpbox.search(regx_chr) == -1) {
    alert('Adaugti cel putin un caracter.\n Doar litere, [, ], |, ?, .');
    return false;
  }
}

document.getElementById('register').onsubmit = checkForm;
Then in your Administration Panel => Display => Templates =>Profile => profile_add_body => Edit
Find:
Code:
<!-- BEGIN switch_namechange_allowed -->
   <tr>
      <td class="row1" width="38%"><span class="gen">{L_USERNAME}:*</span></td>
      <td class="row2"><input class="post" type="text" name="username" value="Using php in posts is called being a smart [Language]... Stop it" size="25" maxlength="25" /></td>
   </tr>
   <!-- END switch_namechange_allowed -->
see - size="25" maxlength="25", change the underline numbers with maximum number of characters you want. Wink

Guest
Guest


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum