Skip to content
Extraits de code Groupes Projets
Valider b1c1175c rédigé par root's avatar root
Parcourir les fichiers

javascript validations for username

parent 75caecc6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
:javascript
$(function() {
var Validation = {
username: {
characters: /^(|[A-Za-z0-9_]{0,32})$/,
length: [6, 32]
}
};
$("#user_username").keypress(function(evt) {
if(!Validation.username.characters.test(this.value + String.fromCharCode($
evt.preventDefault();
}
});
});
= form_for(resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :put }) do |f|
%p
= f.label :username
......
:javascript
$(function() {
var Validation = {
username: {
characters: /^(|[A-Za-z0-9_]{0,32})$/,
length: [6, 32]
}
};
$("#user_username").keypress(function(evt) {
if(!Validation.username.characters.test(this.value + String.fromCharCode($
evt.preventDefault();
}
});
});
.span-12.prepend-6.last
.floating
%h3
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter