Pre-Populate Users Auto-Fill Information

Hello everyone,

I had a question similar to: How to pre-fill form input fields at page load - #5 by JWebsBz

I am looking to pre-populate a website visitors auto-fill information on page load, instead of making them click the box or start typing to use the auto-fill info. I have the code to pre-fill input fields, although I need that to be a visitors information, not pre-entered information.

<script>

$( document ).ready(function() {
    // after the page elements are all loaded, then run the script
    // Set the input field with unique ID #email to a value

    $("#email").val('someone@test.com');

    // Set the input field with unique ID #name

    $("#name").val('John Doe');
    
    });

See this Auto-fill form values based on URL querystring

Thanks @samliew,

Do you know if there is a way to use that same script, but pre-populate that information with the browsers autofill, without a user clicking, or begin typing in the input box?

Here is an example of the type of autofill information I’m talking about:

Thanks for all your help!

No. Each browser has their own implementation of autofill, and there is no way to access that information for security reasons.

2 Likes

I thought that may have been the case. Thankyou again for all your help!

If they have filled in the same form before though, you could set a cookie so you can read the values the next time and insert the values into the same fields.


Also, feel free to contact me for further code help and/or customization of third-party plugins

3 Likes

Ok, that could still be helpful. I’ll look into that!

1 Like