haterapps / fake-data

Fake Data - A form filler you won't hate
39 stars 2 forks source link

Add class or other attribute selectors #24

Closed jeffdoubleyou closed 1 year ago

jeffdoubleyou commented 1 year ago

Hello,

To disable auto form filling on an internal company site that I primarily use this tool for, I am not using a descriptive ID or name on my form fields.

Is there any reason there is no class or something like 'data-formField' css selectors in use for determining fields?

I would like to be able to add "class=company" or "data-formField=company" to identify a field as being a "company" without setting the form field name or ID to "company".

Is there any way to achieve this?

Thanks.

haterapps commented 1 year ago

Hello,

In the "Manage Field" popup you can change the selector of the input, so you can add [data-formField=company]

Let me know if this helps.

Thanks!

jeffdoubleyou commented 1 year ago

Hi, thank you for the reply, but this doesn't work for me. I don't have anything in the unnamed fields list. The input elements do have names and IDs, but they are UUIDs and not anything that would match a generator, such as "0d141e4b-40dd-4003-ad1c-283e71142705".

It seems like there should be a way to match a generator based on a class name or other CSS selector, not just form field names and IDs.

haterapps commented 1 year ago

I see. But what if you try this: When you manage an input field with that long UUID name, there is an option to save it as "Unnamed field", and after selecting that you can customise the selector.

In order for this to work, make sure you:

  1. don't have the UUID name saved as "Named Field". If you do, then delete it.
  2. Have the option to Fallback to Unnamed Fields is checked under Settings -> Developer Options -> Field Matching -> Fallback Named Fields to Unnamed Fields

Please see this quick short demo recording on the points I described above:

https://share.getcloudapp.com/6quNDb7X

jeffdoubleyou commented 1 year ago

Thank you, this works for me!