So, I am a real beginner in js and I have a form with 2 inputs. In this inputs I have date pickers so that the user can select a date from a calendar. But the db from the site I work on has this date format: Y M D 0000:00:00. I want to add those zeros at the end automatically when a user selects a date. Don't know if anyone can help, but thanks.
window.onload = function(){
new JsDatePick({
useMode:2,
target:"inputField",
dateFormat:"%Y-%M-%d"
});
new JsDatePick({
useMode:2,
target:"inputField2",
dateFormat:"%Y-%M-%d"
});
};
<form action="insert.php" method="post" target="000:00:00 "onsubmit="return validateForm(this)">
<label for="FUP start date">FUP start date:</label>
<input type="text" name="inputField" id="inputField"/>
</br>
</br>
<label for="FUP end date">FUP end date: </label>
<input type="text" name="inputField2" id="inputField2" />