When I navigate to the file below (datepicker.jsp) the datepicker is displayed and works as expected.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style type="text/css">
@import "./jquery.datepick.package-4.0.4/jquery.datepick.css";
</style>
<script type="text/javascript" src="./jquery.datepick.package-4.0.4/jquery-1.4.4.js"></script>
<script type="text/javascript" src="./jquery.datepick.package-4.0.4/jquery.datepick.js"></script>
<script type="text/javascript">
$(function() {
$('#datepicker').datepick();
});
function showDate(date) {
alert('The date chosen is ' + date);
}
</script>
<title>jQuery Datepicker</title>
</head>
<body>
<p>A popup datepicker <input type="text" id="datepicker"></p>
</body>
</html>
However when I embed the page in a tab like so –
<s:div id="three" label="Add" href="/Dates/datepicker.jsp">
</s:div>
The date picker popup is not displayed.
Do I need to reference the div within the function call to -$(‘#datepicker’).datepick(); ?
Thanks for any help.
Ok,
Here is the link to the tab –
<div dojoType="struts:BindDiv" id="two" label="Add" href="/Dates/DatePicker.jsp" showError="true" parseContent="true">
</div>
And here is DatePicker.jsp –
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style type="text/css">
@import "./jquery.datepick.package-4.0.4/jquery.datepick.css";
</style>
<script type="text/javascript" src="./jquery.datepick.package-4.0.4/jquery-1.4.4.js"></script>
<script type="text/javascript" src="./jquery.datepick.package-4.0.4/jquery.datepick.js"></script>
<script type="text/javascript">
$(function() {
$('#datepicker').datepick();
});
function showDate(date) {
alert('The date chosen is ' + date);
}
</script>
<title>jQuery Datepicker</title>
</head>
<body>
<p>A popup datepicker <input type="text" id="datepicker"></p>
</body>
</html>
Thanks again
I’ve changed to using google jquery plugin and seems to be working well.