Guest --Jonas -- Postado Outubro 20, 2008 Denunciar Share Postado Outubro 20, 2008 to aqui me degladiando com o IE...tenho um js que funciona em todos os browsers menos no belo internet explorer....to a tres dias tentando resolver... sem sucesso, peço ajuda então.function valida(fm) { var msg=''; var lFoi=true; msg="\nInforme os campos obrigatorios:\n"; if ((document.fm.txtEndres.value=='')||(document.fm.txtEndnum.value=='')||(document.fm.txtErba.value=='')||(document.fm.txtErcid.value=='')||(document.fm.txtCep.value=='')||(document.fm.txtERDDD.value=='')||(document.fm.txtErtel.value=='')) { msg+="\n-Inf. Residenciais:\n"; if (document.fm.txtEndres.value=='') { lFoi=false; document.getElementById("endres").innerHTML='<font color="#CE0000">*Endereço</font>'; msg+="\n *Endereço"; } else { document.getElementById("endres").innerHTML='*Endereço'; } if (document.fm.txtEndnum.value=='') { lFoi=false; document.getElementById("endnum").innerHTML='<font color="#CE0000">*N</font>'; msg+="\n *N"; } else { document.getElementById("endnum").innerHTML='*N'; } if (document.fm.txtErba.value=='') { lFoi=false; document.getElementById("erba").innerHTML='<font color="#CE0000">*Bairro</font>'; msg+="\n *Bairro"; } else { document.getElementById("erba").innerHTML='*Bairro'; } if (document.fm.txtErcid.value=='') { lFoi=false; document.getElementById("ercid").innerHTML='<font color="#CE0000">*Cidade</font>'; msg+="\n *Cidade"; } else { document.getElementById("ercid").innerHTML='*Cidade'; } if (document.fm.txtCep.value=='') { lFoi=false; document.getElementById("cep").innerHTML='<font color="#CE0000">*CEP</font>'; msg+="\n *CEP"; } else { document.getElementById("cep").innerHTML='*CEP'; } if (document.getElementById('dddtel').value=='') { lFoi=false; document.getElementById("erddd").innerHTML='<font color="#CE0000">*DDD</font>'; msg+="\n *DDD"; } else { document.getElementById("erddd").innerHTML='*DDD'; } if (document.fm.txtErTel.value=='') { lFoi=false; document.getElementById("ertel").innerHTML='<font color="#CE0000">*Telefone</font>'; msg+="\n *Telefone\n"; } else { document.getElementById("ertel").innerHTML='*Telefone'; }//*/ } não funciona exatamente nessa parte... mas tá igual as outras (a não ser que eu esteja muito cego). if (document.getElementById('dddtel').value=='') { lFoi=false; document.getElementById("erddd").innerHTML='<font color="#CE0000">*DDD</font>'; msg+="\n *DDD"; } else { document.getElementById("erddd").innerHTML='*DDD'; } if (document.fm.txtErTel.value=='') { lFoi=false; document.getElementById("ertel").innerHTML='<font color="#CE0000">*Telefone</font>'; msg+="\n *Telefone\n"; } else { document.getElementById("ertel").innerHTML='*Telefone'; }me ajudem por favor! (não sei se esse é o lugar certo pra postar esse tipo de coisa, se não for, me desculpem) Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 fercosmig Postado Outubro 20, 2008 Denunciar Share Postado Outubro 20, 2008 o que acontece no ie?apresenta erro?não executa? Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 Jonathan Queiroz Postado Outubro 20, 2008 Denunciar Share Postado Outubro 20, 2008 Cara aparentemente seu JS tá certoTenta postar o código da página todaPode ser que tenha escrito o nome de algum campo do formulário errado Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 Guest --Jonas -- Postado Outubro 21, 2008 Denunciar Share Postado Outubro 21, 2008 Ele dá erro, e ainda por cima retorna true o maldito... ou pelo menos é isso que o IE entende.Fala que objeto é nulo ou não é um objeto....isso os objetos dos forms (document.fm.ErTel.value)tudo lá no html tá igualzinho... inclusive até coloquei as id igual a propriedade name (ouvi falar que o IE considera que é a mesma coisa), mas nada....Obrigado pela força! Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 fercosmig Postado Outubro 21, 2008 Denunciar Share Postado Outubro 21, 2008 posta o form completo para testes Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Guest --Jonas --
to aqui me degladiando com o IE...
tenho um js que funciona em todos os browsers menos no belo internet explorer....
to a tres dias tentando resolver... sem sucesso, peço ajuda então.
function valida(fm) { var msg=''; var lFoi=true; msg="\nInforme os campos obrigatorios:\n"; if ((document.fm.txtEndres.value=='')||(document.fm.txtEndnum.value=='')||(document.fm.txtErba.value=='')||(document.fm.txtErcid.value=='')||(document.fm.txtCep.value=='')||(document.fm.txtERDDD.value=='')||(document.fm.txtErtel.value=='')) { msg+="\n-Inf. Residenciais:\n"; if (document.fm.txtEndres.value=='') { lFoi=false; document.getElementById("endres").innerHTML='<font color="#CE0000">*Endereço</font>'; msg+="\n *Endereço"; } else { document.getElementById("endres").innerHTML='*Endereço'; } if (document.fm.txtEndnum.value=='') { lFoi=false; document.getElementById("endnum").innerHTML='<font color="#CE0000">*N</font>'; msg+="\n *N"; } else { document.getElementById("endnum").innerHTML='*N'; } if (document.fm.txtErba.value=='') { lFoi=false; document.getElementById("erba").innerHTML='<font color="#CE0000">*Bairro</font>'; msg+="\n *Bairro"; } else { document.getElementById("erba").innerHTML='*Bairro'; } if (document.fm.txtErcid.value=='') { lFoi=false; document.getElementById("ercid").innerHTML='<font color="#CE0000">*Cidade</font>'; msg+="\n *Cidade"; } else { document.getElementById("ercid").innerHTML='*Cidade'; } if (document.fm.txtCep.value=='') { lFoi=false; document.getElementById("cep").innerHTML='<font color="#CE0000">*CEP</font>'; msg+="\n *CEP"; } else { document.getElementById("cep").innerHTML='*CEP'; } if (document.getElementById('dddtel').value=='') { lFoi=false; document.getElementById("erddd").innerHTML='<font color="#CE0000">*DDD</font>'; msg+="\n *DDD"; } else { document.getElementById("erddd").innerHTML='*DDD'; } if (document.fm.txtErTel.value=='') { lFoi=false; document.getElementById("ertel").innerHTML='<font color="#CE0000">*Telefone</font>'; msg+="\n *Telefone\n"; } else { document.getElementById("ertel").innerHTML='*Telefone'; }//*/ }não funciona exatamente nessa parte... mas tá igual as outras (a não ser que eu esteja muito cego).if (document.getElementById('dddtel').value=='') { lFoi=false; document.getElementById("erddd").innerHTML='<font color="#CE0000">*DDD</font>'; msg+="\n *DDD"; } else { document.getElementById("erddd").innerHTML='*DDD'; } if (document.fm.txtErTel.value=='') { lFoi=false; document.getElementById("ertel").innerHTML='<font color="#CE0000">*Telefone</font>'; msg+="\n *Telefone\n"; } else { document.getElementById("ertel").innerHTML='*Telefone'; }me ajudem por favor! (não sei se esse é o lugar certo pra postar esse tipo de coisa, se não for, me desculpem)
Link para o comentário
Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.