ton exemple marche niquel, j'ai exactement pareil mai ça ne marche pas?
je comprend pas:
<script language="JavaScript">
function InitialiserZone(inseeagt){
alert ("inseeagt:"+inseeagt); //il m'affiche bien l'insee: 121212321232124
var valsexe = inseeagt.slice(0,1);
var valannee = inseeagt.slice(1,3);
alert("ma valsexe"+valsexe);//il m'affiche bien 1
document.inscription.sexe.value=valsexe;
alert("ma value"+document.inscription.sexe.value);//là il m'affiche rien alors qu'il deverai m'afficher 1!!!
document.inscription.annee.value=valannee;
}
l'appel de la fonction est correct je pense,
je croi que c'est au niveau du formulaire:
<form name="inscription" method="post" action="BIsejsporrach_ess.php"> //à cette ligne html me l'affiche en noire soidisant il y a une erreur, mai je ne vois pas ou elle est?
<table border="0" width="400" >
<tr>
<td width="200" height="42"><b>idagt</b></td>
<td width="200">
<?php echo $agt['idAgents']; ?>
<input name="idagt" type="hidden" value='<?=$agt['idAgents'] ?>' size="10" maxlength="30">
</td>
</tr>
<tr>
<td width="600"><b>INSEE</b></td>
<td width="" >
<input type="text" name="sexe" value="" size="1" maxlength="1" "#" onKeyup="Compter(this,this.form.annee);" id="idsexe" readonly="readonly">
</td>
<td width="" >
<input type="text" name="annee" size="1" maxlength="2" "#" onkeyup="Compter(this,this.form.mois);" id="idannee" readonly="readonly">
</td>
<td width="200" >
<input type="text" name="mois" size="1" maxlength="2" "#" onkeyup="Compter(this,this.form.dept);" id="idmois" value='<?=$_POST['mois'] ?>' readonly="readonly">
</td>
<td width="200" >
<input type="text" name="dept" size="1" maxlength="2" "#" onkeyup="Compter(this,this.form.code1);" id="iddept" value='<?=$_POST['dept'] ?>' readonly="readonly">
</td>
<td width="200" >
<input type="text" name="code1" size="1" maxlength="3" "#" onkeyup="Compter(this,this.form.code2);" id="idcode1" value='<?=$_POST['code1'] ?>' readonly="readonly">
</td>
<td width="200" >
<input type="text" name="code2" size="1" maxlength="3" "#" onkeyup="Compter(this,this.form.cle);" id="idcode2" value='<?=$_POST['code2'] ?>' readonly="readonly">
</td>
<td width="200" >
<input type="text" name="cle" size="4" maxlength="2" "#" id="idcle" value='<?=$_POST['cle'] ?>' readonly="readonly" >
</td>
<td width="200" >
<input type="text" name="NIR" size="10" id="idNIR" maxlength="13" value='<?=$_POST['NIR'] ?>' readonly="readonly">
</td>
<td width="200" >
<input type="text" name="inseeagt" size="15" id="inseeagt" maxlength="15" value='<?=$agt['InseeAgt'] ?>' readonly="readonly" >
</td>
<td width="200" >
<input type="button" name="modif" value="Modifier" onclick= "if (confirm('Voulez-vous modifier l\'INSEE ?')) ModifInsee();" />
</td>
</tr>
</form>
et j'ai plusieurs formulaire mais de nom different,
Merci de me sauver