Ver Mensaje Individual
  #7 (permalink)  
Antiguo 02/01/2009, 10:03
darkmcloud
 
Fecha de Ingreso: octubre-2007
Mensajes: 191
Antigüedad: 17 años, 5 meses
Puntos: 0
Respuesta: Javascript que ejecuta otro javascript

compadre....aca esta el codigo :


Código asp:
Ver original
  1. <html>
  2. <meta http-equiv="Expires" content="0">
  3. <meta http-equiv="cache-control" content="no-store">
  4. <head>
  5. <title>Consulta de Facturas</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
  7. <!--
  8. body,td,th {
  9.     color: #FFFFFF;
  10. }
  11. body {
  12.     background-image: url(images/2.jpg);
  13. }
  14. -->
  15. </style></head>
  16. <body onLoad="document.frmClientes.rut.focus();" >
  17. <SCRIPT LANGUAGE="JAVASCRIPT">
  18.  
  19. function validar(form)
  20. {
  21. var error = "POR FAVOR, ANTES DE ENVIAR EL FORMULARIO, DEBE COMPLETAR LOS SIGUIENTES CAMPOS:\n\n";
  22. var a = ""
  23.  
  24.     if (form.rut.value == "") { a += "RUT \n"; }
  25.       if (form.razon.value == "") { a += "RAZON SOCIAL\n"; }
  26.     if (form.folio.value == "") { a += "FOLIO FACTURA\n"; }
  27.     if (form.orden.value == "") { a += "Nº PEDIDO\n"; }
  28.      
  29.  
  30.    
  31.    
  32.     if (a != "") { alert(error + a); return true; }
  33.  insertar()
  34. }
  35.  
  36.  
  37.  
  38.  
  39. function insertar()
  40.     {  
  41.    
  42.         document.frmClientes.action='insert_clientes.asp?rut='+ document.frmClientes.rut.value+'&razon='+document.frmClientes.razon.value +'&folio='+document.frmClientes.folio.value  +'&fecha='+document.frmClientes.fecha.value  +'&orden='+ document.frmClientes.orden.value;
  43.         document.frmClientes.method="POST";
  44.         document.frmClientes.submit();
  45.     }
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.     </SCRIPT>
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. <form name="frmClientes" method="post" action="2.asp" autocomplete  = "off">
  62.   <table width="971" border="0" cellpadding="2" cellspacing="2">
  63.     <tr>
  64. <td width="120" height="32"> Rut </td>
  65.  
  66. <td width="250"> Razon Social</td>
  67. <td width="120">Factura N°:</td>
  68. <td width="120">Fecha:</td>
  69. <td width="202"> N° Pedido </td>
  70.      
  71.        
  72. <tr>
  73. <td width="120" ><input name="rut" value="15792248-3"> </td>
  74.  
  75. <td width="250"><input name="razon" value="Dark Mcloud Inc." size=50></td>
  76. <td width="120"><input name="folio" value="" size=20 ></td>
  77. <td width="120"><input name="fecha" value="02-01-2009" readonly size=20 ></td>
  78. <td width="202"><input name="orden" value="" size=20></td>  
  79.        
  80.    
  81.    
  82.    
  83.     <tr>
  84.      
  85.       <td colspan="2" align=left>
  86.         <p>
  87.            
  88.           <input name="submit" type="submit" value="Buscar">
  89.  
  90. </td>
  91.    
  92.  
  93.  
  94.      <td colspan="2" align=left>
  95.    
  96.  <input type="button" value="Terminar" onClick="validar(this.form)">
  97.    
  98.     </td>
  99.    
  100.      </tr>
  101.   </table>
  102. </FORM>
  103. </body>
  104. </html>

el error es :

Linea: 49
Caracter: 9
Error: El Objeto no acepta esta propiedad o metodo
Codigo: 0
Direccion URL : http://localhost/inventario/2.asp...

de antemano muchas gracias