Jump to content

[Solved] Auto fill in first name and last name in registration


pepperoni

Recommended Posts

hi all,

In the registration form we have the first name and last name on the top.
When someone fills these boxes then it auto completes the first name and last name boxes further down.
That is cool!!

BUT
Most browsers now they keep certain form information and help fill a form quicker by remembering some fields.
For example while you are in the first name box and you type just the first letter of your name it will give you the option like a popup of your name. If you select it then the other first name box below it will not auto complete.
It will only auto-complete the first letter you typed and not the whole name.

Looking at the code of authentication.tpl file I can see the onkeyup event which I assume is jquery??
That means when I press the key it will copy it to the other box below. That's why auto-complete won't work.

Is there any solution for this? Meaning that if I can somehow by changing the code or by using something similar to onkeyup I can make possible for a better auto-complete of the first and last name boxes below?

Alternatively can I disable completely the first and last name boxes below and just keep the first ones on the top without having error in validation process?

Any thoughts or suggestions are welcome.
Thanks in advance.

Link to comment
Share on other sites

Back on this issue...


The top first name box is the customer_firstname variable.
The bottom first name box is the firstname variable.

Is there a way to declare that when form is been submitted the value of customer_firstname is equal to fistname ?

thanks people

Link to comment
Share on other sites

Right.
I managed to solve this.
What I have done is replaced the onkeyup=... with onblur=... for the first name and last name fields on the top.

That would copy the values you type to the bottom boxes of first and last name soon as you leave the boxes.

Then I have hidden the bottom first and last name boxes as I didn't want them in the first place because we still have them on the top. (just add style="display:none;")
No errors at all when submitting the form.
Happy :)

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...