Page 1 of 1

Automatically select "First Name" field on checkout STEP-2?

Posted: Wed May 22, 2024 4:39 am
by supak111
I would like the first name field to be automatically selected when a customer reaches STEP-2 on checkout

Is there a way to do this?

Re: Automatically select "First Name" field on checkout STEP-2?

Posted: Wed May 22, 2024 5:21 am
by straightlight
supak111 wrote:
Wed May 22, 2024 4:39 am
I would like the first name field to be automatically selected when a customer reaches STEP-2 on checkout

Is there a way to do this?
OC version. If you're referring to guest customers that should have a selected first name field, I would not suggest that approach to be used since customers do have the right to modify their billing and shipping information that can differ with their customer's account when logged in to their account.

Re: Automatically select "First Name" field on checkout STEP-2?

Posted: Wed May 22, 2024 5:50 am
by supak111
OC 3.0.3.2
I just want it selected so that customer can just start typing their first name without having to manually click on the first name field before they can start typing. Its no different than going to STEP-2 and clicking "Tab" button on your keyboard so the cursor moves over into the first name field

It would just speed up checkout, I don't see how it could do any harm

PS I read somewhere adding "autofocus" into the input tag would do this but I haven't had luck (maybe I'm doing it to the wrong file). Like this:

Code: Select all

<input name="q" autofocus />
.

Re: Automatically select "First Name" field on checkout STEP-2?

Posted: Wed May 22, 2024 6:18 am
by straightlight
supak111 wrote:
Wed May 22, 2024 5:50 am
OC 3.0.3.2
I just want it selected so that customer can just start typing their first name without having to manually click on the first name field before they can start typing. Its no different than going to STEP-2 and clicking "Tab" button on your keyboard so the cursor moves over into the first name field

It would just speed up checkout, I don't see how it could do any harm

PS I read somewhere adding "autofocus" into the input tag would do this but I haven't had luck (maybe I'm doing it to the wrong file). Like this:

Code: Select all

<input name="q" autofocus />
.
You're talking about the pointer. By doing that, however, it would also encourage bots to autofill the forms (even though they can already do it without the autofocus). This free extension could probably shed some light with some modifications on how to achieve this: https://www.opencart.com/index.php?rout ... n_id=37437 .

Re: Automatically select "First Name" field on checkout STEP-2?

Posted: Wed May 22, 2024 12:20 pm
by supak111
Yea thats what I thought I had to do, just an add "autofocus" to the end of <input> tag but I can't seem to get it to work. Im probably adding it to the wrong file.

What file should it be added to so that it works on "Guest" checkout?

Thanks for the help btw ツ
.

Re: Automatically select "First Name" field on checkout STEP-2?

Posted: Wed May 22, 2024 6:40 pm
by paulfeakins
supak111 wrote:
Wed May 22, 2024 4:39 am
I would like the first name field to be automatically selected when a customer reaches STEP-2 on checkout
I would suggest using a One Page Checkout instead: https://www.antropy.co.uk/blog/whats-th ... -opencart/