我正在使用jQuery日期选择器在我的页面上查看日历。
我以正确的顺序导入库,但它不起作用。
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page language="java"%>
<%@page import="java.sql.*"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
<link type="text/css" href="css/jquery-ui.css"/>
<script type="text/javascript" src="JS/jquery-2.2.4.js"></script>
<script type="text/javascript" src="JS/jquery-ui.min.js"></script>
<script>
$(function(){
$("#fecha").datepicker();
});
</script>
<style>
.tabla{
width: 80%;
}
.thCliente{
font-family:sans-serif;
font-size: 16px;
font-weight: bolder;
background: cadetblue;
}
.tdCliente{
font-family:sans-serif;
font-size: 14px;
background: beige;
align-content: stretch;
}
</style>
</head>
<body>
<table id="cliente" border="1" class="tabla">
<form method="get" action="generaReporte" id="forminicio">
<tr><th class="thCliente">Febrero</th></tr>
<th class="thCliente">Fecha </th>
<th class="thCliente">Cliente</th>
<th class="thCliente">Actividad</th>
<th class="thCliente">Horas</th>
<tr>
<th>
<input id="fecha" type="text">
</th>
<th>
<%//establecemos la conexion a la BD para mostrar los clientes
try
{
Connection conexion = null;
Statement sentencia = null;
ResultSet resultado = null;
Class.forName("com.mysql.jdbc.Driver");
String cadenaConexion = "jdbc:mysql://localhost:3306/LOGIN";
String usuario = "root";
String clave = "5533834712";
conexion = DriverManager.getConnection(cadenaConexion,usuario,clave);
if(!conexion.isClosed())
{
sentencia = conexion.createStatement();
resultado = sentencia.executeQuery("select * from cliente");
out.println("<select style='width:300px;border:1px;font-family:sans-serif;font-size: 16px;' name='select'>");
out.println("<option >Selecciona el Cliente</option>");
while(resultado.next())
{
String nombre = resultado.getString("Nombre");
//String id = resultado.getString("id");
out.println("<option value='"+nombre+"'></option>");
}
out.println("</select>");
conexion.close();
}
else
out.println("fallo");
}
catch(Exception e)
{
out.println("Error"+e);
e.printStackTrace();
}
%>
</th>
<th>
<input type="text" style="width:300px;border:1px;font-family:sans-serif;font-size: 16px;" value="Agregar tu Actividad" name="actividad">
</th>
<th>
<input type="text" maxlength="4" style="width:300px;border:1px;font-family:sans-serif;font-size: 16px;" value="Añade tu tiempo" name="actividad">
</th>
<th>
<input type="button" value="Guardar" name="save">
</th>
</tr>
</form>
</body>
</html>发布于 2016-06-08 12:00:46
有时,正常的jQuery日期选择器会出错,不能给出正确的输出。我已经习惯了。一个使用标准jQuery日期选择器的很好的日期选择器。你可以自定义这个比普通日期选择器更多的东西。也是一个很好的文档。这在我的jsp页面上工作得很好。
发布于 2016-06-08 12:12:13
它可以正常工作,请检查https://jsfiddle.net/5h5vb0nj/。您是任务表关闭标签
</th>
</tr> ***</table>***
</form>
</body>如果问题仍然存在,那么删除scriptlet并检查它现在是否正常工作。如果iot工作,则意味着scriptlet中存在错误。
https://stackoverflow.com/questions/37692927
复制相似问题