Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a submit javascript code

Status
Not open for further replies.

dandrey

Technical User
Apr 28, 2005
41
CO
Hi, i'm trying to do a submit but it doesn't work, i have a form and outside of it i've placed a submit button with an OnChange function named validar();

this is the code:

<script language="JavaScript">
//alert("no tiene nada el cliente");
function validar(){
var mensaje="";
var sw1=0, sw2=0, sw3=0;
mensaje="Por favor, ingrese los siguientes elementos:\n\n"
if (document.frmllamadas.cliente.value==""){
mensaje+="Nombre del Cliente\n";
sw1=1
}
if (document.frmllamadas.perfil.value=="0"){
mensaje+="Perfil del Cliente\n";
sw2=1
}
if (document.frmllamadas.pais.value=="0"){
mensaje+="País del Cliente\n";
sw3=1
}
if (sw1==1 || sw2==1 || sw3==1){
alert(mensaje);} else{
document.frmllamadas.pasd.value="T";
document.frmllamadas.submit();
}

}
</script>

but like i said before it doesn't work, what is wrong?

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top