The placeholder is an attribute and can not be taken by the value property of the element. You need to use the getAttribute method:
var startDate = document.getElementById("startDate").getAttribute("placeholder");
This will give you the date time value. I have created a demo in jsFiddle using your example code.
If you want to take the value when the form is submitted using JavaScript, i suggest you to use jQuery. A possible solution could look like this:
<form action="javascript:alert('test');">
<input type="text" name="startDate" id="startDate" placeholder="July 21, 1983 13:15:00">
<br/>
<input type="submit" value="show value" />
</form>
And the form submit handler that parses the entered value, check if it is a correct date and shows the year:
var startDate = document.getElementById("startDate").getAttribute("placeholder");
// alert(startDate);
// handle form request
$( "form" ).submit(function(event) {
// get the entered value
var value = $("#startDate").val();
// show entered value or inform user to enter something
var message = "Please enter something.";
if (value) {
// is it a date?
var date = Date.parse(value);
if (!isNaN(date)) {
// yes ...
message = "You entered the year " + (new Date(date)).getFullYear();
}
else {
// no :(
message = "Please enter a correct date like 2014-01-01";
}
}
alert(message);
// do not submit the form for the test
event.preventDefault();
});
I have updated the jsFiddle demo, so that the entered value is shown when the user submits the form.
Dateobject format?