Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/12/2008, 18:54
darkmcloud
 
Fecha de Ingreso: octubre-2007
Mensajes: 191
Antigüedad: 17 años, 4 meses
Puntos: 0
Respuesta: Javascript que ejecuta otro javascript

compadre....mi codigo completo es :

Código asp:
Ver original
  1. <%@ Language=VBScript %>
  2. <% Response.addHeader " ", "no-cache" %>
  3. <% Response.CacheControl = "Private" %>
  4. <% Response.Expires=0 %>
  5. <%
  6.  
  7. if Not IsEmpty(Request("rut")) then
  8.         rut = Request("rut")
  9.     end if
  10.     session("rut") =9999-9
  11.  
  12. set Cnn=Server.CreateObject("ADODB.Connection")
  13.     set rs=Server.CreateObject("ADODB.Recordset")
  14.     Cnn.Open Session("cnx")
  15.  
  16. strSQL = "select * from FACPVTA where rut='" &  rut & "' "
  17.          set rs = Cnn.Execute(strSQL)
  18.          cnn.Execute(strSQL)
  19.          
  20.          If Not rs.EOF then
  21.        
  22.         rut1   = rs.Fields("RUT")
  23.         session("rut") = rs.fields ("RUT")
  24.         razon  = rs.Fields("RAZON")
  25.         fecha_actual=date()
  26.         else
  27.        
  28. session("rut") =9999-9
  29.        
  30.        
  31.         end if
  32.      
  33.          
  34. %>
  35.  
  36.  
  37.  
  38.  
  39. <html>
  40. <meta http-equiv="Expires" content="0">
  41. <meta http-equiv="cache-control" content="no-store">
  42. <head>
  43. <title>Consulta de Facturas</title>
  44. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
  45. <!--
  46. body,td,th {
  47.     color: #FFFFFF;
  48. }
  49. body {
  50.     background-image: url(images/2.jpg);
  51. }
  52. -->
  53. </style></head>
  54. <body onLoad="document.frmClientes.rut.focus();" >
  55. <SCRIPT LANGUAGE="JAVASCRIPT">
  56.  
  57. function validar(form)
  58. {
  59. var error = "POR FAVOR, ANTES DE ENVIAR EL FORMULARIO, DEBE COMPLETAR LOS SIGUIENTES CAMPOS:\n\n";
  60. var a = ""
  61.  
  62.     if (form.rut.value == "") { a += "RUT \n"; }
  63.       if (form.razon.value == "") { a += "RAZON SOCIAL\n"; }
  64.     if (form.folio.value == "") { a += "FOLIO FACTURA\n"; }
  65.     if (form.orden.value == "") { a += "Nº PEDIDO\n"; }
  66.      
  67.  
  68.    
  69.    
  70.     if (a != "") { alert(error + a); return true; }
  71.  insertar()
  72. }
  73.  
  74.  
  75.  
  76.  
  77. function insertar()
  78.     {  
  79.    
  80.         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;
  81.         document.frmClientes.method="POST";
  82.         document.frmClientes.submit();
  83.     }
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.     </SCRIPT>
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99. <form name="frmClientes" method="post" action="facturas_final.asp" autocomplete  = "off">
  100.   <table width="971" border="0" cellpadding="2" cellspacing="2">
  101.     <tr>
  102. <td width="120" height="32"> Rut </td>
  103. <%if session("rut") <>9999-9 then%>
  104. <td width="250"> Razon Social</td>
  105. <td width="120">Factura N°:</td>
  106. <td width="120">Fecha:</td>
  107. <td width="202"> N&deg; Pedido </td>
  108.  <%end if %>    
  109.        
  110. <tr>
  111. <td width="120" ><input name="rut" value="<%=rut%>"> </td>
  112. <%if session("rut") <>9999-9 then%>
  113. <td width="250"><input name="razon" value="<%=razon%>" size=50></td>
  114. <td width="120"><input name="folio" value="<%=folio%>" size=20 ></td>
  115. <td width="120"><input name="fecha" value="<%=fecha_actual%>" readonly size=20 ></td>
  116. <td width="202"><input name="orden" value="<%=orden%>" size=20></td>  
  117.     <%end if %>  
  118.    
  119.    
  120.    
  121.     <tr>
  122.      
  123.       <td colspan="2" align=left>
  124.         <p>
  125.            
  126.           <input name="submit" type="submit" value="Buscar">
  127.  
  128. </td>
  129.    
  130.  
  131. <%if session("rut") <>9999-9 then%>
  132.      <td colspan="2" align=left>
  133.    
  134.  <input type="button" value="Terminar" onClick="validar(this.form)">
  135.    
  136.     </td>
  137.     <%end if %>
  138.      </tr>
  139.   </table>
  140. </FORM>
  141. </body>
  142. </html>

y me dice error de "el objeto no acepta esta propiedad o metodo"...linea 49
y esa es la de:

body {
background-image: url(images/2.jpg);
}

o sea extraño el error.....que podra ser ??