Datequery Jquery calendars are not displayed

0

I have the code of two calendar JQuery in my form but they are not displayed, even though I copied the code from an official JQuery page:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">

  <link href="styles.css" media="screen" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="css/jquery-ui-1.7.2.custom.css" />
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css"/>
  
  

  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <script src="javascript/valida_sancion.js"></script>

  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
  <script type="text/javascript" src="./javascript/cambio.js"></script>
  <script type="text/javascript" src="./javascript/refrescado.js"></script>
  <script type="text/javascript" src="./javascript/borrar.js"></script>
  <script type="text/javascript" src="./javascript/limite.js"></script>
  <script type="text/javascript" src="./javascript/mostrar.js"></script>
  <script type="text/javascript" src="./javascript/ocultar.js"></script>
  <script type="text/javascript" src="./javascript/nombre.js"></script>
  <script type="text/javascript" src="./javascript/ventana.js"></script>
  <script type="text/javascript" src="./javascript/validar.js"></script>


<script type="text/javascript">
jQuery(function($){
  $.datepicker.regional['es'] = {
    closeText: 'Cerrar',
    prevText: '&#x3c;Ant',
    nextText: 'Sig&#x3e;',
    currentText: 'Hoy',
    monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
    'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
    monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
    'Jul','Ago','Sep','Oct','Nov','Dic'],
    dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'],
    dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'],
    dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','S&aacute;'],
    weekHeader: 'Sm',
    dateFormat: 'yy/mm/dd',
    firstDay: 1,
    isRTL: false,
    showMonthAfterYear: false,
    yearSuffix: ''};
  $.datepicker.setDefaults($.datepicker.regional['es']);
});    
 
   $(document).ready(function() {
           $("#datepicker1").datepicker({ appendText: ' Haga click para introducir una fecha' });
           $("#datepicker2").datepicker({ appendText: ' Haga click para introducir una fecha' });
        });
</script>


  <script>
  $(document).ready(function() {    
    $('#cedula1').blur(function(){
    
        $('#info1').html('<img src="loader.gif" alt="" />').fadeOut(1000);

        var cedula1 = $(this).val();        
        var dataString = 'cedula1='+cedula1;

        $.ajax({
            type: "POST",
            url: "comprobar_disponibilidad1.php",
            data: dataString,
            success: function(data) {
                $('#info1').fadeIn(1000).html(data);
            }
        });
    });              
});    
</script>

<script>
$(document).ready(function() {    
    $('#cedula2').blur(function(){
    
        $('#info2').html('<img src="loader.gif" alt="" />').fadeOut(1000);

        var cedula2 = $(this).val();        
        var dataString = 'cedula2='+cedula2;

        $.ajax({
            type: "POST",
            url: "comprobar_disponibilidad2.php",
            data: dataString,
            success: function(data) {
                $('#info2').fadeIn(1000).html(data);
            }
        });
    });              
});    
</script>

    <script>    
    $(document).ready(function(){

      //Modificamos option de nuestro 'SELECT'
      $("#articulo").change(function(){

          $.ajax({
            url:"cambiar-datos-select.php",
            type: "POST",
            data:"id_select="+$("#articulo").val(),

            success: function(opciones){
              $("#apartado").html(opciones);
            }
          });
      });


      //Formulario procesar4
      $(document).on('submit', '#frm-sancion', function() {

        //Obtenemos datos formulario
        var data = $(this).serialize();  

        $.ajax({            
          type : 'POST',
          url  : 'procesar4.php',
          data : data,
          success :  function(data) { 
            $(".result").html(data); 
          }
        });    

        return false;

      });

    }); //Fin documento
  </script>
</head>

<body onload="refrescado();valida()">

<?php
@session_start();
if(!isset($_SESSION["user_id"]) || $_SESSION["user_id"]==null){
  print "<script>alert(\"Acceso invalido!\");window.location='index.php';</script>";
}
?>
<?php include "php/navbar.php"; ?>
<?php
include "conexion.php";
?>

<form id="frm-sancion" method="POST" name="sancion" action ="procesar4.php">
<h1>Generar Sanción<br></h1>

   <div>
   <label>Ingrese cedula del sancionado:</label>
   <input type="text" id="cedula1" name="cedula1">
   <label id="info1">
   </div>
   


   <div>
   <label>Ingrese cedula del sancionador:</label>
   <input type="text" id="cedula2" name="cedula2">
   <label id="info2">
   </div>
   

 <div>
 <label>Ingrese tipo de sanción:</label>
 <select name="sancion">
<?php
global $cone;
  $registros = mysqli_query($cone, "select * from sanciones");
  while ($reg = mysqli_fetch_array($registros)) {
       echo "<option value=" . $reg['id_sancion']  . ">" . $reg['sancion']  . "<br/>" . "</option>";
  
  }
?>
      </select>
    </div>



  <div>
  <label>Ingrese articulo inflingido:</label>
  <select name="articulo" id="articulo">
      <option value="0">Seleccione un art+iculo:</option>
      <?php
    $registros = mysqli_query($cone, "SELECT * FROM articulos");
    $descripciones = '';
    while ($reg = mysqli_fetch_array($registros)) {
        echo "<option value=" . $reg['id_articulo'] . ">" . $reg['articulo'] . "</option>";
    }
  ?>
    </select>

  <div>
  <label>Ingrese aparte:</label>
  <select id="apartado" name="aprtado"> 
    <option value="0">Seleccione primero un articulo</option> 
  </select>      
</div>

<div class="result"><!-- Resultado AJAX procesar --></div>

  <div>
     <label>Ingrese Fecha inicial de la sanción:</label>
     <input type="text" name="fecha1" readonly id="datepicker1">
    </div>

<div>
     <label>Ingrese Fecha Final de la sanción:</label>
     <input type="text" name="fecha2" readonly id="datepicker2" >
</div>

<div>
     <label>Ingrese la observación:</label>
     <input type="text" name="observacion" name="observacion">
</div>


<div>
<label>Ingrese tipo de circuntancia:</label></br>
<input type="radio" name="tipo_sancion" id="ninguno" onclick="toggle(this);" value ="0" checked > Ninguno </br>
<input type="radio" name="tipo_sancion" id="comida fuerte" onchange="darNombre(this);" onclick="toggle(this);borrar();limite;" value="1"> Comida Fuerte <br/>
<input type="radio" name="tipo_sancion" id="comida sopa" onchange="darNombre(this);" onclick="toggle(this);borrar();limite;" value="2"> Comida Sopa <br/>
</div>   
    
<div id="uno">
Elija su comida fuerte

<?php
global $cone;
$registros= mysqli_query($cone, "SELECT * FROM comida_fuerte");
while($comida = mysqli_fetch_array($registros)){
echo "</br>"."<input type='checkbox'  onclick='validacionMaximo(this);' name='comida_fuerte[]'
value='".$comida['id_comida_fuerte']."'>".$comida['desc_comida_fuerte']."</br>";
}
?>
</div>

<div id="dos">
Elija su sopa

<?php
global $cone;
$registros2= mysqli_query($cone, "SELECT * FROM comida_sopa");
while($comida2 = mysqli_fetch_array($registros2)){
echo "</br>"."<input type='checkbox' name='comida_sopa[]'  onclick='validacionMaximo(this);' value='".$comida2["id_comida_sopa"]."'>".$comida2["desc_comida_sopa"]."</br>";
}
?>
</div>


<div>
<label>Elija las circunstancias:</label>
<select name="circunstancias">

<?php
global $cone;
  $registros = mysqli_query($cone, "select * from circunstancias");
  while ($reg = mysqli_fetch_array($registros)) {
       echo "<option value=" . $reg['id_circunstancia']  . ">" . $reg['desc_circunstancia']  . "<br/>" . "</option>";
  
  }
?>
      </select>
</div>

<div>
<label>Elija la documentación:</label>

<?php
global $cone;
$registros= mysqli_query($cone, "SELECT * FROM documentos");
while($comida = mysqli_fetch_array($registros)){
echo "</br>"."<input type='checkbox' name='documentos[]' value='".$comida['id_documento']."'>".$comida['desc_documento']."</br>";
}
?>
</div>

<button type="submit" id="registrar" value="registrar">Enviar</button>
</form>


</body>
</html>
    
asked by Victor Alvarado 20.02.2017 в 15:43
source

1 answer

4

Edit

A.

The jquery ui library is missing: https://code.jquery.com/ui/1.12.1/jquery-ui.js include it at the beginning and it will work. See the test at jsfidle :

  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

The jsfiddle example uses the following libraries:

https://code.jquery.com/jquery-1.12.4.js
https://code.jquery.com/ui/1.12.1/jquery-ui.js

Even though you have a library called: http://code.jquery.com/ui/1.10.1/jquery-ui.js your code does not work, because it must be called with http s , I've done the test in jsfiddle. That library can delete it and leave the one indicated above in the answer, version 1.12.1 :) Although if you want to continue with 1.10.1 it will work if you put a s after http

>

B.

As for the redundant libraries, delete the duplicates, leaving the ones with the higher version number, because they will be more updated. There may also be bookstores that are called different and do the same, but that is your business to investigate and decide to use one or the other:)

    
answered by 20.02.2017 / 15:56
source