Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/07/2014, 16:52
jmfmagnum
 
Fecha de Ingreso: julio-2014
Mensajes: 116
Antigüedad: 9 años, 10 meses
Puntos: 1
Jquery datepicker no funciona en un formulario PHP

Buenas Tardes, me presento soy Jose soy nuevo y vengo humildemente a pedir ayuda (no se si sea el foro adecuado si no lo es algun admin se encargara)estoy en mi practica laboral y debo hacer cambios a un archivo
este archivo introduce datos a una base de datos, todo bien hasta que debi pasar la partes de dicen fechas (fechas de nacimiento fechas de toma muestra ETC.) de usar varias a cajas a un textbox que usa Jquery Datepicker, el datepicker funciona bien
pero al momento de ingresar el formulario a la base de datos este ingresa todo lo que habia en el datepicker en nulo,a la primera fecha le agregue "date " quedando en " GetSQLValueString(date("Y-m-d",($HTTP_POST_VARS['anonac'])), "date"),"
lo unico que logre es que ingrese la fecha default de todo PC (31-12-1969),
no se que mas hacer, como el codigo es largo , ingresare partes aqui y dejare un link para ver el codigo completo

[URL="https://mega.co.nz/#!ppgyxIpA!JaOEkuNG3LqQp03TQi_Q7f5wD5Z4_pcDQPh-dNtToyc"]Archivo Completo[/URL]

Extracto de codigo que ingresa a BD

Código:
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO hospnot (fechadig, usuario, nompac, apellpac, fnac, edad, sexo, rut, dv, direc, comuna, consultorio, nommad, fono, otrofono, finghosp, nficha, finidiarr, psangre, psotro, ftomamuestra, tecdiaglab, resultado, nomhosp, unilab, respnom, respfono, respfax, respmail, respfenvmues, ispresultado, region, emeses) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString(date("Y-m-d H:i:s"), "date"),
                       GetSQLValueString($HTTP_POST_VARS['usuario'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['nombres'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['apellidos'], "text"),
                   //  GetSQLValueString($HTTP_POST_VARS['anonac']."-".$HTTP_POST_VARS['mesnac']."-".$HTTP_POST_VARS['dianac'], "date"),
                       GetSQLValueString(date("Y-m-d",($HTTP_POST_VARS['anonac'])), "date"),
					  // GetSQLValueString($HTTP_POST_VARS['anonac'], "date"),
					   GetSQLValueString($HTTP_POST_VARS['edad'], "int"),
                       GetSQLValueString($HTTP_POST_VARS['sexo'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['rut'], "int"),
                       GetSQLValueString($HTTP_POST_VARS['dv'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['direccion'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['comuna'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['consultorio'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['nomadre'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['fonomad'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['ofonomad'], "text"),
                      // GetSQLValueString($HTTP_POST_VARS['anoing']."-".$HTTP_POST_VARS['mesing']."-".$HTTP_POST_VARS['diaing'], "date"),
                       GetSQLValueString($HTTP_POST_VARS['anoing'], "date"),
					   GetSQLValueString($HTTP_POST_VARS['nfichaclin'], "int"),
                      // GetSQLValueString($HTTP_POST_VARS['anodiarr']."-".$HTTP_POST_VARS['mesdiarr']."-".$HTTP_POST_VARS['diadiarr'], "date"),
                       GetSQLValueString($HTTP_POST_VARS['anodiarr'], "date"),
					   GetSQLValueString($HTTP_POST_VARS['sangre'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['sangreotro'], "text"),
                      // GetSQLValueString($HTTP_POST_VARS['anotom']."-".$HTTP_POST_VARS['mestom']."-".$HTTP_POST_VARS['diatom'], "date"),
                       GetSQLValueString($HTTP_POST_VARS['anotom'], "date"),  
					   GetSQLValueString($HTTP_POST_VARS['tecdiag'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['resultado'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['nomhosp'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['unilab'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['nomresp'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['fonoresp'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['faxresp'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['mailresp'], "text"),
                      // GetSQLValueString($HTTP_POST_VARS['anoenv']."-".$HTTP_POST_VARS['mesenv']."-".$HTTP_POST_VARS['diaenv'], "date"),
                       GetSQLValueString($HTTP_POST_VARS['anoenv'], "date"),   
					   GetSQLValueString($HTTP_POST_VARS['ispresultado'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['region'], "int"),
                       GetSQLValueString($HTTP_POST_VARS['meses'], "int"));

  mysql_select_db($database_brotediarreas, $brotediarreas);
  $Result1 = mysql_query($insertSQL, $brotediarreas) or die(mysql_error());

--Codigo Jquery Datepicker

Código:
<link rel="stylesheet" href="jquery-ui-1.10.4/development-bundle/themes/redmond/jquery.ui.all.css" rel="stylesheet" type="text/css"/>
    <script src="jquery-ui-1.10.4/js/jquery-1.10.2.js"></script>
	<script src="jquery-ui-1.10.4/development-bundle/ui/jquery.ui.core.js"></script>
	<script src="jquery-ui-1.10.4/development-bundle/ui/jquery.ui.widget.js"></script>
	<script src="jquery-ui-1.10.4/development-bundle/ui/jquery.ui.datepicker.js"></script>
    <script src="jquery-ui-1.10.4/development-bundle/ui/i18n/jquery.ui.datepicker-es.js"></script>
<link rel="stylesheet" href="jquery-ui-1.10.4/development-bundle/demos/demos.css" rel="stylesheet" type="text/css"/>
  
    <script type="text/javascript">
$(document).ready(function(e) {
    $("#anonac").datepicker({dateFormat: 'yy-mm-dd', changeMonth: true, changeYear: true, yearRange: '-6:+0'});
});


$(document).ready(function(e) {
    $("#anoing").datepicker();
});


$(document).ready(function(e) {
    $("#anodiarr").datepicker();
});

$(document).ready(function(e) {
    $("#anotom").datepicker();
});

$(document).ready(function(e) {
    $("#anoenv").datepicker();
});


</script>
ejemplo de input
Código:
  <tr> 
            <td><font size="2" face="Arial Narrow"><font color="#FF0000">Fecha 
              de nacimiento:</font> </span> <input type="text" name="anonac"  size="15" id="anonac"/></font>
              </td>
          </tr>

desearia poner todo el codigo, pero es muy largo, perdon por usar su tiempo, ojala alguien pueda ayudarme porque es urgente