haterapps / fake-data

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

Ability to change hidden fields #8

Closed Gamesh closed 3 years ago

Gamesh commented 3 years ago

Would it be possible to change fillout hidden fields. Like <input type=hidden> or styled fields, that are replaced by other html markup. For example a select dropdown get replaced by the javascript version of a field for autocompletion, the original select is still available but is hidden. Or radio/checkbox inputs that are hidden and a div is displayed so they can be styled.

haterapps commented 3 years ago

Hello,

It is possible to extend Fake Data for custom elements, like dropdowns or radio buttons, that are not standard HTML form elements.

The thing is that every implementation would be different because there are so many third party libraries out there.

Here is a sample and a starting point that you might find useful:

Let's take this jQuery niceSelect library: https://jqueryniceselect.hernansartorio.com/

In order to make Fake Data work with that, you can use the following script: https://gist.github.com/haterapps/779a5155816bc11854c7d6a936e5bd19

The above script needs to be loaded inside Fake Data Options page -> Settings -> Developer Options -> Loaded Libraries -> Foreground Libraries

Once that is loaded, you can see that the dropdowns on niceSelect website will be filled when you fill the entire page, and can even be managed by right-clicking on them.

Here is a short demo recording with all of the above: https://a.cl.ly/z8u6P5nr

I hope that helps.