Probleme avec onChange sur IE
jamalsurf
Messages postés
29
Statut
Membre
-
Dalida Messages postés 7114 Date d'inscription Statut Contributeur Dernière intervention -
Dalida Messages postés 7114 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
Voici un script avec javscript qui marche trés bien FF et non sur IE :
window.onload = function(){
if (document.getElementById) {
document.getElementById('oneOrMoreTraining').onchange = function(){
if(document.getElementById('oneOrMoreTraining').value == Oui"){
document.getElementById('laquelle').innerHTML = '<td>Laquelle (lesquelles) ? *<'+'/'+'td><td> :</td><td><input type="text" name="otherTraining" id="otherTraining" class="input" /><'+'/'+'td>';
}else document.getElementById('laquelle').innerHTML = ' ';
}
if (document.all) {
document.all['oneOrMoreTraining'].onChange = function(){
if(document.all['oneOrMoreTraining'].value == "Oui"){
document.all['laquelle'].innerHTML = '<td>Laquelle (lesquelles) ? *<'+'/'+'td><td> :</td><td><input type="text" name="otherTraining" id="otherTraining" class="input" /><'+'/'+'td>';
}else document.all['laquelle'].innerHTML = ' ';
}
}
quelqu'un a une idée pour résoudre ce bug avec IE ?
Et merci d'avence.
cdt,
Voici un script avec javscript qui marche trés bien FF et non sur IE :
window.onload = function(){
if (document.getElementById) {
document.getElementById('oneOrMoreTraining').onchange = function(){
if(document.getElementById('oneOrMoreTraining').value == Oui"){
document.getElementById('laquelle').innerHTML = '<td>Laquelle (lesquelles) ? *<'+'/'+'td><td> :</td><td><input type="text" name="otherTraining" id="otherTraining" class="input" /><'+'/'+'td>';
}else document.getElementById('laquelle').innerHTML = ' ';
}
if (document.all) {
document.all['oneOrMoreTraining'].onChange = function(){
if(document.all['oneOrMoreTraining'].value == "Oui"){
document.all['laquelle'].innerHTML = '<td>Laquelle (lesquelles) ? *<'+'/'+'td><td> :</td><td><input type="text" name="otherTraining" id="otherTraining" class="input" /><'+'/'+'td>';
}else document.all['laquelle'].innerHTML = ' ';
}
}
quelqu'un a une idée pour résoudre ce bug avec IE ?
Et merci d'avence.
cdt,