displaying current date in a text box - javascript
<p>I am having great difficulty getting the current date to be inputted into a text box within a form i am creating as a default value. at the moment i have the following code, which i believe creates the current date, followed by the text box code which i am unsure on how to modify in order for the date to be displayed inside.</p>

<pre><code>function getDate(){
 var todaydate = new Date();
 var day = todaydate.getDate();
 var month = todaydate.getMonth() + 1;
 var year = todaydate.getFullYear();
 var datestring = day + "/" + month + "/" + year;
 document.getElementById("frmDate").value = datestring();
} 
&lt;input type="text" name="frmDateReg" required id="frmDate"  value="getDate()"&gt;
</code></pre>

<p>if anyone could suggest how to create todays date and input it into the textbox as default it would be greatly appreciated. (Please excuse any format issues as i am new to stack overflow) Thanks</p>