Jquery :: Problème / Button Disabled/Enabled if input fields > 6
Résolu/Fermé
Geishin
Messages postés
9
Date d'inscription
mardi 20 mai 2014
Statut
Membre
Dernière intervention
30 juin 2014
-
Modifié par Geishin le 25/05/2014 à 04:55
R4DHW3N - 30 nov. 2016 à 10:22
R4DHW3N - 30 nov. 2016 à 10:22
A voir également:
- Jquery :: Problème / Button Disabled/Enabled if input fields > 6
- Belote a 6 - Forum Loisirs / Divertissements
- Input signal out of range ✓ - Forum Matériel informatique
- Freebox etape 6 ✓ - Forum Freebox
- If exist ✓ - Forum Autoit / batch
- Vba if not ✓ - Forum Excel
2 réponses
Salut, je suis pas très bon en jquery, j'ai essayé ceci et sa fonctionne. C'est peut être pas la meilleure façon de faire.
bonne journée
<script type="text/javascript">
$(function() {
var verif;
$(".idinput").keyup(function() {
$(".idinput").each(function() {
verif = ($(this).val().length) > 6 ? true : false;
if (verif == false)
return false;
});
verif == true ? $("#next").attr("disabled", false) : $("#next").attr("disabled", true);
});
});
</script>
bonne journée
Geishin
Messages postés
9
Date d'inscription
mardi 20 mai 2014
Statut
Membre
Dernière intervention
30 juin 2014
1 juin 2014 à 21:23
1 juin 2014 à 21:23
Je te remercie. :)
30 nov. 2016 à 10:22
var $t = $(this);
var $e = $("#btnsub");
if (!$t.val()) {
$e.attr("disabled", true);
} else {
$("#nom").keyup(function() {
var $tn = $(this);
var $e = $("#btnsub");
if (!$tn.val()) {
$e.attr("disabled", true);
} else {
$("#email").keyup(function() {
var $te = $(this);
var $e = $("#btnsub");
if (!$te.val()) {
$e.attr("disabled", true);
} else {
$("#numero").keyup(function() {
var $tnum = $(this);
var $e = $("#btnsub");
if (!$tnum.val()) {
$e.attr("disabled", true);
} else {
$e.removeAttr('disabled');
}
}).keyup();
}
}).keyup();
}
}).keyup();
}
}).keyup();