Fonction javascript onclick
Résolu
fille95
Messages postés
65
Date d'inscription
Statut
Membre
Dernière intervention
-
fille95 Messages postés 65 Date d'inscription Statut Membre Dernière intervention -
fille95 Messages postés 65 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
ma fonction ne fonctionne pas, je ne vois pas pourquoi?
pouvez vous m'aider svp?
function verifForm(nom) {
var vNom = /^[a-zA-Z0-9_]*$/;
var VARnom = document.forms[0].elements[nom].value;
if((VARnom =="" || vNom.test(VARnom ) == false) )
{
document.getElementById('nom_obl').style.visibility ='visible';
}
else
{
document.getElementById('nom_obl').style.visibility ='hidden';
}
}
<input id="valider" value="Valider" onclick="verifForm('nom')" type="submit">
ma fonction ne fonctionne pas, je ne vois pas pourquoi?
pouvez vous m'aider svp?
function verifForm(nom) {
var vNom = /^[a-zA-Z0-9_]*$/;
var VARnom = document.forms[0].elements[nom].value;
if((VARnom =="" || vNom.test(VARnom ) == false) )
{
document.getElementById('nom_obl').style.visibility ='visible';
}
else
{
document.getElementById('nom_obl').style.visibility ='hidden';
}
}
<input id="valider" value="Valider" onclick="verifForm('nom')" type="submit">
A voir également:
- Fonction javascript onclick
- Fonction si et - Guide
- Telecharger javascript - Télécharger - Langages
- Fonction miroir - Guide
- Fonction moyenne excel - Guide
- Fonction remplacer sur word - Guide