rachidphp93
Messages postés212Date d'inscriptionvendredi 17 mars 2006StatutMembreDernière intervention 8 avril 2007
-
18 avril 2006 à 13:27
Hermios
Messages postés264Date d'inscriptiondimanche 14 avril 2013StatutMembreDernière intervention23 mai 2014
-
1 mai 2006 à 18:38
bonjour,
j'ai un formulaire de saisi et je souhaiterais passer quelques case de lecture seule (readnly) en ecriture (remouveAttribute(readonly)). Le probleme c'est que mon
getElementById()prend en compte que le premeir remouve en fait il le fait que pour une case mais pas les autres?
voila mon script:
<script language= "javascript">
function ModifInsee(){
document.getElementById('idsexe').removeAttribute('readonly');
document.getElementById('idanee').removeAttribute('readonly');
alert ("coucou");
document.getElementById('idmois').removeAttribute('readonly');
document.getElementById('iddept').removeAttribute('readonly');
document.getElementById('idcode1').removeAttribute('readonly');
document.getElementById('idcode2').removeAttribute('readonly');
document.getElementById('inseeagt').removeAttribute('readonly');
}
</script>
<tr>
<td width="600"> INSEE </td>
<td width ="" >
' readonly="readonly">
</td>
<td width="" >
' readonly="readonly">
</td>
<td width="200" >
' readonly="readonly">
</td>
<td width="200" >
' readonly="readonly">
</td>
<td width="200" >
' readonly="readonly">
</td>
<td width="200" >
' readonly="readonly">
</td>
<td width="200" >
' readonly="readonly" >
</td>
<td width="200" >
' readonly="readonly">
</td>
<td width="200" >
' readonly="readonly" >
</td>
<td width="200" >
</td>
</tr>
Merci de votre aide,
Hermios
Messages postés264Date d'inscriptiondimanche 14 avril 2013StatutMembreDernière intervention23 mai 20142 1 mai 2006 à 18:38
Simplifie toi la vie, évite les erreurs entre le javascript et le html: tu n'as pas le même Id pour le deuxième texte en html(idannee) et dans ton instruction javascript (idanee), comme quoi un n peut vous changer la vie!!!