Bonjour à tous,
J'aimerais pouvoir désactiver/activer des champs texte en fonction d'un choix de combobox. Mon code marche sous Firefox mais sous IE il ne passe rien.
Que dois-je faire ?
Code Javascript : Sélectionner tout - Visualiser dans une fenêtre à part
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 function afficherType(param){ if(param=="1"){ window.document.getElementById('text_sonde').disabled = true; window.document.getElementById('livesearch_sonde').disabled = true; window.document.getElementById('livesearch_mesureur').disabled = true; window.document.getElementById('text_sonde').value = ""; window.document.getElementById('livesearch_sonde').value = ""; window.document.getElementById('livesearch_mesureur').value = ""; } else if(param=="2"){ window.document.getElementById('livesearch_mesureur').disabled = false; window.document.getElementById('livesearch_sonde').disabled = true; window.document.getElementById('text_sonde').disabled = true; window.document.getElementById('text_sonde').value = ""; window.document.getElementById('livesearch_sonde').value = ""; } else { window.document.getElementById('livesearch_sonde').disabled = false; window.document.getElementById('text_sonde').disabled = false; window.document.getElementById('livesearch_mesureur').disabled = false; } }
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <input type="radio" value="3" id="3" name="type" onClick="afficherType('3');" checked> <label for="3">3</label><br /> <input type="radio" value="2" id="2" name="type" onClick="afficherType('2');"> <label for="2">2</label><br /> <input type="radio" value="1" id="1" name="type" onClick="afficherType('1');"> <label for="1">1</label>








Répondre avec citation
Partager