Código:
SALUDOS <script language="JavaScript"> <script language="JavaScript"> <!-- /*********************************************** * Required field(s) validation v1.10- By NavSurf * Visit Nav Surf at http://navsurf.com * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ function formCheck(formobj){ // Enter name of mandatory fields var fieldRequired = Array("txtNombreCia", "txtNombre","txtRFC","txtRazon","txtDir","txtTel","txtCorreo","continentes","paises","estados"); // Enter field description to appear in the dialog box var fieldDescription = Array("Nombre Compania", "Nombre Contacto","RFC","Razon Social","Direccion","Telefono","Correo Electronico","Pais","Estado","Ciudad"); // dialog message var alertMsg = "Por favor complete los siguientes campos:\n\n"; var l_Msg = alertMsg.length; for (var i = 0; i < fieldRequired.length; i++){ var obj = formobj.elements[fieldRequired[i]]; if (obj){ switch(obj.type){ case "select-one": if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "select-multiple": if (obj.selectedIndex == -1){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "text": case "textarea": if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; default: } if (obj.type == undefined){ var blnchecked = false; for (var j = 0; j < obj.length; j++){ if (obj[j].checked){ blnchecked = true; } } if (!blnchecked){ alertMsg += " - " + fieldDescription[i] + "\n"; } } } } if (alertMsg.length == l_Msg){ return true; }else{ alert(alertMsg); return false; } } // --> </script> .... <form action="enviar.asp" method="post" name="mundo" onsubmit="return formCheck(this);"> <TD> <% ... Response.Write "<FONT class=""Estilo8""><B>*Pais:</B></FONT><td><select size=""1"" name=""continentes"" onChange=paises_trae(this.value)>" Response.Write "<option value="""">SELECCIONE EL PAIS</option>" "OJO" SI LE PONGO EL TEXTO DE SELECCIONE PAIS NO LO VALIDA, SI LO QUITO SI LO VALIDA Do While (NOT rs2.EOF) id_item = rs2("id_item") item_descripcion = rs2("item_descripcion") Response.Write "<OPTION VALUE=""" & id_item & """>" & item_descripcion & "</OPTION>" rs2.MoveNext Loop Response.Write "</select>" ...%> </TD>