D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] inputbox focus

 

On Fri, Jan 29, 2010 at 12:06 PM, kevin wrote:
> Can I ask if any one knows a "Simple" way of getting an anchor in html
> to go to an input box?
> ie: (or ff) I would like to have a link on a page which puts the cursor
> in an input box called "plu" I can get the page to move to the same line
> as the box but not the cursor inside the box

I'm pretty sure think it can't be done in plain HTML. But the
JavaScript is really simple:

<a href="#anchor" onclick="document.getElementById('textbox').focus()">click</a>

and then make sure to add id="textbox" to your textbox declaration.

Martijn.

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html