[pmwiki-users] can the cursor be positioned on forms?

Patrick R. Michaud pmichaud at pobox.com
Tue Mar 21 13:10:25 CST 2006

On Tue, Mar 21, 2006 at 01:49:28PM -0500, Neil Herber wrote:
> My User/password form is almost working, except the cursor gets 
> placed into the password field (which is second on the page) instead 
> of the name field (first). Is there a way to force the "focus"?

Eeek, I had forgotten about that.

Try the following:

$AuthPromptFmt = array(&$PageStartFmt, 'page:$SiteGroup.AuthForm',
  "<script language='javascript' type='text/javascript'><!--
    try { document.authform.author.focus(); }
    catch(e) { document.authform.authpw.focus(); } //--></script>",

I might see if I can find a generic javascript snippet that will
always focus the first field in the form (instead of an explicitly
named field as it does now).


More information about the pmwiki-users mailing list