I have two date fields on my Visualforce page and on occasions the datepicker/calendar pops up upon page load. I understand one way to prevent this is to use javascript as suggested below:
<input id="hiddenElementId" type="hidden" />
<script type="text/javascript">
window.onload = setFocus
function setFocus()
{
document.getElementById("hiddenElementId").focus();
}
</script>
https://developer.salesforce.com/forums?id=906F000000094kJIAQ
However this post is pretty old now, is this still considered the best way to do this?