No funcionan timepicker y datepicker en la misma página
Publicado por Nely Guerrero (1 intervención) el 20/01/2017 20:27:43
Hola
Estoy haciendo unos campos de registro en un formulario.
Unos campos llevan datepicker y otroa timepicker.
Quito el timepicker y el datepicker funciona perfectamente.
Si pongo los dos solo funciona el timepicker.
codigo de los dos....
Estoy haciendo unos campos de registro en un formulario.
Unos campos llevan datepicker y otroa timepicker.
Quito el timepicker y el datepicker funciona perfectamente.
Si pongo los dos solo funciona el timepicker.
codigo de los dos....
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!--codigo para timepicker -->
<style type="text/css" media="all">@import "material/timePicker.css";</style>
<style type="text/css">
div {
margin-top:3em;
}
input {
margin:0;
padding:0;
}
body {
background: #eee;
}
pre {
background:#fff;
border:1px solid #ddd;
padding:4px;
}
.error {
border:1px solid red;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script type="text/javascript" src="material/jquery.timePicker.js"></script>
<script>
jQuery(function() {
$("#hora1").timePicker({
startTime: "00:00", // Using string. Can take string or Date object.
endTime: new Date(0, 0, 0, 23, 00, 0), // Using Date object.
show24Hours: true ,
separator:':',
step: 15});
});
</script>
<script>
jQuery(function() {
$("#hora2").timePicker({
startTime: "00:00", // Using string. Can take string or Date object.
endTime: new Date(0, 0, 0, 23, 00, 0), // Using Date object.
show24Hours: true ,
separator:':',
step: 15});
});
</script>
<script>
jQuery(function() {
$("#hora3").timePicker({
startTime: "00:00", // Using string. Can take string or Date object.
endTime: new Date(0, 0, 0, 23, 00, 0), // Using Date object.
show24Hours: true ,
separator:':',
step: 15});
});
</script>
<script type="text/javascript">
// Analytics.
var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-123444-3"]),_gaq.push(["_trackPageview"]),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()
</script>
<!-- fin de codigo de timepicker -->
<!-- codigo de datepicker -->
<script>
$(function () {
$("#fecharegistro2").datepicker({
changeMonth: true,
changeYear: true
});
});
$(function () {
$("#fechaevento3").datepicker({
changeMonth: true,
changeYear: true
});
});
$(function () {
$("#fechaentrega3").datepicker({
changeMonth: true,
changeYear: true
});
});
$(function () {
$("#hora1").timepicker({});
});
</script>
<script>
$.datepicker.regional['es'] = {
closeText: 'Cerrar',
prevText: '<Ant',
nextText: 'Sig>',
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ércoles', 'Jueves', 'Viernes', 'Sábado'],
dayNamesShort: ['Dom','Lun','Mar','Mi','Juv','Vie','Sáb'],
dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
weekHeader: 'Sm',
dateFormat: 'yy/mm/dd',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''
};
$.datepicker.setDefaults($.datepicker.regional['es']);
$(function () {
$("#fecha").datepicker();
});
</script>
<!-- fin de codigo datepicker -->
Valora esta pregunta
0