I have the following code below. The alert and the output is not working.
<apex:page standardController="Account">
<script>
//Some javascript to handle the datepicker..
function showDatePicker(thisPtr) {
DatePicker.pickDate(true, thisPtr.id, false);
}
</script>
<script type="text/javascript">
function calculate(){
var t = document.getElementById("date1").value;
if (t != null) {
var t1= document.getElementById("date2").value;
t1 = t;
else{
alert('Please enter the Initial Sign up Date');
}
}
</script>
<apex:form >
Initial Sign up Date : <input type = "date" onfocus = "showDatePicker(this)"
name="date1"/>
<button onclick="calculate()">GO</button>
<output type = "date" name="date2"/>
</apex:form>
</apex:page>