For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2005 > RE: [PEAR] how to make (using javascript or otherwise) cursor go to username field in









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PEAR] how to make (using javascript or otherwise) cursor go to username field in
George Pitcher

2005-03-30, 3:57 pm

Hi,

The following will do it for you:

<script language="JavaScript">
<!-- Begin
function toForm() {
document.form1.username.focus();
}
</script>

Replace 'username' in the script with the field name of which you want to
place the focus. Also, give the form a name: <form name="form1" ...>


Cheers

George
> -----Original Message-----
> From: l Burnerheimerton [mailto:lburnerheimerton@yahoo.com]
> Sent: 30 March 2005 3:53 pm
> To: pear-general@lists.php.net
> Subject: [PEAR] how to make (using javascript or otherwise) cursor go to
> username field in AUTH when page loads?
>
>
> I am using AUTH and like it. I want to make it so
> that when the page loads, the cursor is in the first
> field. Now you have to click in that field.
>
> Thanks.
>
> function loginFunction()
> {
> ...
> echo "<input type=\"text\" name=\"logName\"><BR>";
> echo "<input type=\"pass\" name=\"pass\"><BR>";
> ...
> }
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com