I am trying to be able to display a texbox with a default value from php. I also want a function to run when the textbox is selected to tell the user what format the data should be entered in. I am trying
<td><input name="sdate" type="text" maxlength="11" value=<?php echo '"'.date("Y")."-01-01"; ?> onfocus="dateHelp()"/></td>
But it isn't working and is displaying "2006-01-01 onfocus=" inside the text box, and not running the dataHelp. If I remove the php and use
<td><input name="sdate" type="text" maxlength="11" value="" onfocus="dateHelp()"/></td>
it works fine, but with no default value from php. How can I get them both to work together? I am sure I am missing out something silly like double quotes.