Autofocus INPUT field

How can I have an input field set to autofocus? I want to have the cursor placed inside the text box as soon the page is loaded. Then people can start directly typing without having to move their cursor (mouse) first.

Thanks in advance,

@HPee, Is this a specialised site for an intranet setup? I haven’t come across this on the internet, but I’m thinking for a new user it might be somewhat confusing that they need to eventually click outside the text box field to use the site?

I’m imagining you would need a small bit of clever HTML/CSS and javascript to accomplish this. From what I know of Sparkle it is something not achievable unless you add code to make it happen.
Sorry that I couldn’t help with this…

If you go to, it defaults in the search box. I want something like that for a customer.

In HTML-5, you can do this with the attribute autofocus, like:
input type=“text” name=“fname” autofocus

I was hoping for an option in Sparkle to do the same. A workaround is a piece of javascript that I can put if the code-box (embedded container) to force the focus on that field. But I prefer to keep it clean from coding.


1 Like

@HPee, Well how about that! I don’t use Google for searching instead I use Ecosia (helps to green our planet) so I wasn’t aware of it. But it is very specific to that one action that a user would come to perform.

You would need to embed code to make this work, but give a shout out to @duncan, maybe he can help further with this…

Not currently possible unfortunately.