verification d'un champs html
Bonjour,
J'ai un probléme de verification d'un champs html en Javascript, j'ai un champs d'effectif et un bouton radion et je veux quand je coche : Excelent et l'effectif est inférieur a 50 me signal un message box voici mon code et merci pour votre aide.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<form action ="form1.html">
<p>effectif:
<input name='effectif' type = 'text'><br>
<INPUT type="radio" name="niveau" value=3>Excellent
<BR>
<INPUT type="radio" name="niveau" value=2 checked>Moyen<br>
<INPUT type="button" name="mon_bouton" value="Voici un bouton">
</form>
</p>
</BODY>
</HTML>
<script language = "Javascript">
function isart()
{
if(document.test_html.effectif.value < 50 && document.test_html.niveau.value = 2)
{
alert("hhsggsgfsf");
}
}
</script> |
verification d'un champs html
Merci de votre réponse, j'avais oublié d'applé la fonction javascript , mais comme meme ca marche pas:
voici la modification que j'ai ajouté:
Code:
<input name='effectif' type = 'text' onclick="isart()">