Field References and Changing Values

212 Aufrufe
Direkt zur ersten ungelesenen Nachricht

TM@

ungelesen,
25.01.2023, 14:35:1825.01.23
an Autofill Extension
What I want to do is very simple.. I have a form that has the same value repeated throughout different text fields, so instead of entering each value one by one I can just input one and the rest of the fields populate based on it.

Example:
Screenshot from 2023-01-25 22-26-31.png

So as you see in the picture, I want to populate first and last name fields only and based on the input ( which is different for each form ) it populates the Full Name field and Card User Name field.

I tried doing the following rules in Autofill but it doesn't seem to work, any help would be appreciated.
Screenshot from 2023-01-25 22-30-43.png
Where the value ID's are as following - {v10} = First name, {v11} =  Last name, {v13} = Middle name.

The value of "^02frstname$", "^03middle_i$", etc.... is empty because it changes with every form and I would like to input it myself for each form.

And I would like these values that change to be usable later in the same form but like a different page.

Any help will be appreciated, thanks in advance.
TM

Autofill Extension

ungelesen,
06.02.2023, 20:01:4606.02.23
an Autofill Extension
Below is a minimal proof of concept that you can use as a springboard to get to where you want. For the purposes of this demo, create a new profile.

1. Create a new JavaScript rule and enter this code:

// Define the form fields
const elFirstName = document.querySelector('[name="firstname"]');
const elEmail = document.querySelector('[name="email"]');

// Only execute if these two fields exist on the page
if (elFirstName && elEmail) {
  // Monitor what you enter in "First name" and update "Email" accordingly
  elFirstName.addEventListener('input', (e) => {
    switch (elFirstName.value) {
      case 'Tom':
        elEmail.value = 't...@email.com';
        break;
      case 'Jerry':
        elEmail.value = 'je...@email.com';
        break;
    }
  });
}


3. Enter "Tom" in "First name" field; observe the "Email" field autofilling
4. Enter "Jerry" in "First name" field; observe the "Email" field autofilling a different value
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten