Ver Mensaje Individual
  #16 (permalink)  
Antiguo 09/06/2011, 16:53
oscarbt
 
Fecha de Ingreso: abril-2009
Ubicación: Colombia
Mensajes: 949
Antigüedad: 15 años
Puntos: 27
Respuesta: Unir fecha + hora en un solo campo

sii, quedo asi:

Onblur='unirfechora('formuhc.php','capap','1','".$ registros[$i][2]."f','".$registros[$i][2]."')'

y en ajax:

Código Javascript:
Ver original
  1. function unirfechora(archivo, div, op, fecha, hora){    
  2.     var hc=document.getElementById(div);
  3.    
  4.     var fecha = document.getElementById(fecha).value;
  5.     var hora = document.getElementById(hora).value;
  6.     var fh = fecha+" "+hora;
  7.    
  8.    
  9.    alert(fh);
  10.     var aj=nuevoAjax();
  11.     aj.open("POST", "formuhc.php", true);
  12.     aj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  13.     aj.setRequestHeader("Accept-Charset", "UTF-8");
  14.     aj.send("op="+op+"&fh="+fh);
  15.     aj.onreadystatechange=function(){
  16.         if (aj.readyState==4){
  17.             hc.innerHTML=aj.responseText;
  18.            
  19.         }
  20.     }
  21. }