Wednesday, 4 September 2013

Can't get the Datepicker to show on form using javascript

Can't get the Datepicker to show on form using javascript

I'm trying to add Datepicker to my online form as part of my student
assessment. I'm very new to all this and I'm having issues so any help is
greatly appreciated. I've downloaded and linked to my jquery UI and I've
typed the code as per the jquery UI website states but the calendar
doesn't pop up on my form when I click in the Date field like it suggests,
I've also taken examples from this site but I still can't get it to work
and now I'm just getting confused.
<head>
<link
href="javascript/jquery-ui-1.10.3.custom/css/south-street/jquery-ui-1.10.3.custom.css"
rel="stylesheet">
<script
src="javascript/jquery-ui-1.10.3.custom/js/jquery-1.9.1.js"></script>
<script
src="javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"></script>
<script>
function validate(){
date = document.getElementById("datePicker").value;
errors = "";
if (date == ""){
errors += "Please supply a valid DOB \n";
}
}
</script>
</head>
<body>
<form name= "myform" method="post" action="" class="booking">
<fieldset>
<div>
<label for="datePicker" class="fixedwidth">Date</label>
<input type="text" name="datePicker" id="datePicker"/>
</div>
</fieldset>
</body>

No comments:

Post a Comment