Spring mvc and jQuery DatePicker

We have added a simple CSS using the ResourceHandlers.  Now, it is the time to test jQuery on a Spring MVC. First Step is to display the calendar object on the jsp.

Spring mvc and jQuery DatePicker

Insert the scripts and CSS to head part of jsp

http://code.jquery.com/jquery-1.10.2.js
http://code.jquery.com/ui/1.11.0/jquery-ui.js

		<sc ript type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></sc ript>
		<sc ript type="text/javascript" src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"></sc ript>
		<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">

Add the following javascript. Replace expenseDate with your field id

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

Thats all. The calendar object should rendered on the browser window.

Advertisements

One thought on “Spring mvc and jQuery DatePicker

  1. Pingback: The request sent by the client was syntactically incorrect | JavaShine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s