Enable user input on page load

I want to make user input section enabled when the site page loads. I want to avoid, clicking the user input box through mouse. Just want to make user input section ready, when page loads and user can input value through keyboard.


I have attached the picture, if the answer is 3, user can type 3 from keyboard, without clicking the box through mouse. Any help would be appreciated.

Hi @suffianansari , you can set the focus on the field when the page is ready, use this code:

$w.onReady(function () {
    $w('#answerInput').focus();
})

Read more about the $w.TextInput API - Focus.

Hope that helped!
Ahmad

Hello Ahmad, Thank you for the feedback. It is working.

@suffianansari Glad that it’s working :wink:
You’re welcome