I’m trying to carry out a jsp page with some functionalities of Jquery. But, despite my efforts, there’s no way to do it.
I’ve downloaded jquery1.7.1 and jquery-ui1.8.17 (non-mini), and renamed it to jquery171.js and jquery-ui.js. They are in /js folder.
There’s a very simple jsp page below, which is not showing the DatePicker of jquery. I’m using jquery UI 1.7.1. There’s no errors in the files, just several warnings, like variables never used and not initialized.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<link type="text/css" href="css/ui-lightness/jquery.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"/></script>
<script type="text/javascript" src="js/jquery-ui.js"/></script>
</head>
<body>
<input type="text" id="tx" name="tx"/>
<script type="text/javascript">
$("tx").datepicker({dateFormat: 'dd/mm/yyyy'});
</script>
</body>
</html>
But, when I run the stuff, nothing happens. Have you any idea of where should be the problem? If you have already configured jquery in your Eclipse, what other steps have you did? Thanks in advance.
You are missing
#.Try
$("#tx").datepicker({dateFormat: 'dd/mm/yy'});Also use
yyinstead ofyyyy.ymeans year (two digit)yymeans year (four digit).Check this link for more options.