denbo
Joined: 13 Jun 2007 Posts: 4
|
Posted: Sat Jul 28, 2007 11:55 pm Post subject: Set focus to a secific text box when Page loads |
|
|
I've been trying to use Javascript Focus() function to set the focus to the first textbox entry on my page when it loads (this is q[1] in my form) - something which I consider essential.
It seems the names given to MyContactForms are 'non-standard' and the function doesn't reconise the textbox.
Anyway - for anyone who wants to do the same thing the following code somrwhere between the <body> </body> does the trick, for me asnyway.
<script type="text/javascript">
document.getElementById('q[1]').focus();
</script>
If you try it and it doesn't work for you, don't ask me why. I know nothing about javascript - I'm a novice who is designing my very first website. I got this from a Google search.  |
|