Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/09/2013, 14:55
falkon765
 
Fecha de Ingreso: noviembre-2012
Mensajes: 139
Antigüedad: 11 años, 5 meses
Puntos: 1
Respuesta: Problema con formulario

aqui se dan los datos
Código ASP:
Ver original
  1. <%@ Language="VBScript"  %>
  2. <!--#include file="conexion.asp" -->
  3. <%
  4. sub generaPaises()
  5.     Set B_REGIONES = Server.CreateObject("ADODB.Recordset")
  6.     set B_REGIONES=connBM.execute("BM_BUSCA_REGIONES ")
  7.     ' Voy imprimiendo el primer select compuesto por los paises
  8.     Response.Write "<select class=""combo"" id=""select_0"" name=""select_0"" onChange=""cargaContenido()"" style='width: 260px;'>"
  9.     While not B_REGIONES.EOF
  10.         Response.Write "<option value='"& B_REGIONES("BM_ID_REGION") &"'>" & B_REGIONES("BM_REGION") & "</option>"
  11.         B_REGIONES.MoveNext
  12.     Wend
  13.     Response.Write "</select>"
  14.  
  15.     B_REGIONES.Close   
  16. End sub
  17.  
  18. Set B_REGIONES = Server.CreateObject("ADODB.Recordset")
  19. Response.CodePage = 1252
  20. Response.CharSet = "windows-1252"  
  21. TXT_TUTULO_PRODUCTO_ = Request.querystring("TXT_TITULO")
  22. oid_oferta = Request.querystring("id_oferta")
  23. alerta_1 = Request.QueryString("rs")  
  24. if alerta_1="1"then
  25. %>
  26. <script> alert("usuario ya existe ")</script>
  27. <%end if %>
  28. <%if alerta_1="2"then %>
  29. <script> alert("Las contraseñas deben coincidir")</script>
  30. <%end if %>
  31. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  32. <html xmlns="http://www.w3.org/1999/xhtml">
  33. <head>    
  34.      <meta name="Barrio Meiggs" contents="Barrio Meiggs, Productos,  Locales Estación Central. Jugueterias, Novedades, Adornos, Navidad, Año Nuevo,  Fiestas, Disfrases, Juegos, Deportes,  Cotillon, Articulos de Temporada, Electronica, Utiles Escolares, Utiles de Aseo, Fiestas Patrias, Etc,  Seguridad, Muchos Locales, Arriendo, BarrioMeiggs, Meigs, Meyg, " lang="es">
  35.      <meta http-equiv="Content-Type" charset="iso-8859-1"/>
  36.         <link rel="stylesheet" type="text/css" href="css/formularios.css">
  37.         <script src="Scripts/jquery-1.9.0.js" type="text/javascript"></script>
  38.         <link rel="stylesheet" href="css/jquery.ketchup.css" type="text/css" media="screen" />
  39.         <script src="Scripts/jquery.ketchup.all.min.js" type="text/javascript"></script>
  40.         <title></title>
  41. <script language="javascript">
  42. $(document).ready(function () {
  43. $('#contacto').ketchup({}, {
  44. '.required' : 'required',
  45. '#comentario': 'minlength(10)',
  46. '#email': 'email',
  47. '#txtCant': 'number'    
  48. });
  49. $('#b_region').change(function () { llenarselect(); });  
  50. });
  51. function conMayusculas(campo)
  52. {
  53. campo.value = campo.value.toUpperCase()
  54. }
  55. function validarTexto(e)
  56. {
  57.     tecla = (document.all) ? e.keyCode : e.which;
  58.     if (tecla==8) return true;
  59.     patron =/[A-Za-zÑñ[email protected]]/; //  
  60.     te = String.fromCharCode(tecla);
  61.     return patron.test(te);
  62. }
  63. </script>
  64. <script language="javascript" type="text/javascript">
  65. function nuevoAjax()
  66. {
  67.     /* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
  68.     lo que se puede copiar tal como esta aqui */
  69.     var xmlhttp=false;
  70.     try
  71.     {
  72.         // Creacion del objeto AJAX para navegadores no IE
  73.         xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  74.     }
  75.     catch(e)
  76.     {
  77.         try
  78.         {
  79.             // Creacion del objet AJAX para IE
  80.             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  81.         }
  82.         catch(E) { xmlhttp=false; }
  83.     }
  84.     if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); }
  85.  
  86.     return xmlhttp;
  87. }
  88.  
  89. function cargaContenido()
  90. {
  91.     var valor=document.getElementById("select_0").options[document.getElementById("select_0").selectedIndex].value;
  92.     if(valor==0)
  93.     {
  94.         // Si el usuario eligio la opcion "Elige", no voy al servidor y pongo todo por defecto
  95.         combo=document.getElementById("select_1");
  96.         combo.length=0;
  97.         var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Selecciona Pais...";
  98.         combo.appendChild(nuevaOpcion); combo.disabled=true;
  99.     }
  100.     else
  101.     {
  102. ajax=nuevoAjax();
  103. ajax.open("GET", "llenarprovincia.asp?id="+valor, true);
  104. ajax.onreadystatechange=function()
  105. {
  106. if (ajax.readyState==1)
  107. {
  108. // Mientras carga elimino la opcion "Elige pais" y pongo una que dice "Cargando"
  109. combo=document.getElementById("select_1");
  110. combo.length=0;
  111. var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Cargando...";
  112. combo.appendChild(nuevaOpcion); combo.disabled=true;   
  113. }
  114. if (ajax.readyState==4)
  115. {
  116. document.getElementById("fila_2").innerHTML=ajax.responseText;
  117. }
  118. }
  119. ajax.send(null);
  120. }
  121. }
  122. </script>
  123. </head>
  124. <body >
  125. <img src="img/fondo.jpg" alt="texto alternativo" id="fondo" />
  126. <div id="form-wrapper">
  127. <form id="contacto" action="Para_usuario.asp" method="POST" onload="cargaContenido()" >
  128. <table id="background-image">
  129. <tr >
  130. <th align="center">Registro<br><br>
  131. <a>Nombre &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </a><input name="txtNombre_usu" type="text" size="40" class="required" maxlength="50" onKeyPress="return validarTexto(event);"  /><br><br>      
  132. <a>Apellido &nbsp;&nbsp;&nbsp;&nbsp;   :</a> <input name="txtApellido_usu" type="text" size="40" class="required" maxlength="50" onKeyPress="return validarTexto(event);" /><br><br>
  133. <div id="fila_1">Región   &nbsp;&nbsp;&nbsp;&nbsp; : <% generaPaises() %></div><br>
  134. <div id="fila_2">Provincia &nbsp;&nbsp;&nbsp; :          
  135. <select class="combo" disabled="disabled" id="select_1" name="select_1" style='width: 282px;'>
  136. <option id="valor_defecto" value="0">Elija Región...</option>
  137. </select>
  138. </div><br>
  139. <a>Em@il  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :</a> <input  name="txtemail_usu" type="text" id="email" size="40"  maxlength="50" onKeyPress="return validarTexto(event);" /><br><br>  
  140. <a>Contrase&ntilde;a&nbsp;   :</a> <input name="txtpassword_usu"  type="password" size="40" class="required" maxlength="50" onKeyPress="return validarTexto(event);" /><br><br>
  141. <a>Contrase&ntilde;a&nbsp;   :</a> <input name="txtpassword1_usu" type="password" size="40" class="required" maxlength="50" onKeyPress="return validarTexto(event);" /><br><br>
  142. <a width="182"></a><img src="aspcaptcha.asp" alt="This Is CAPTCHA Image" width="86" height="21" /><br>
  143. <input name="strCAPTCHA" type="text" id="strCAPTCHA" maxlength="8" /><br><br>
  144. <input type="hidden" name="id_2" value="1"/>
  145. <input name="submit" type="submit"  value="Registrarse"/>              
  146. </th>
  147. </tr>
  148. </table>
  149. </form>  
  150. </div>
  151. </body>
  152. </html>