This is all I want.
<form>
<input type="text" name="date" value="currentdate()">
.....</form>
Here I want to set default value as a current date.
This is all I want.
<form>
<input type="text" name="date" value="currentdate()">
.....</form>
Here I want to set default value as a current date.
I don't think you can do that.
But this would work:
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10) {
dd='0'+dd
}
if(mm<10) {
mm='0'+mm
}
today = mm+'/'+dd+'/'+yyyy;
document.getElementById('date').value=today ;
<form>
<input type="text" name="date" id="date">
</form>
I got this solution from Samuel's answer in this post.
You can set a default value to a input, in the DOM, using the document.ready function:
$( document ).ready(function() {
document.getElementById("myInput").defaultValue = myCustomFunction();});
While the question is really unclear and I would recommend an edit be done BY YOU, I will attempt it...
<form action="page.php" method="post">
<input type="text" name="date" value="Enter the date here!" /><br />
<input type="submit" name="submit" value="submit" />
</form>
.....
I dunno if this is what you want but if you want to pass it to a handler you'd need to Google form actions and change the first line's "action" attribute then delete the 'method="post"' part unless you want it.
(Note: The reason I feel like this is what you want is because you made the input a text area... Why would you do that if you want it to display the current date?)