Chaz Meyers (cpm) wrote,
Chaz Meyers

Bookmarklet to fill in forms with prototype.js.

Lately I have had to make too many forms with too many fields. I got angry at the prospect of filling in yet another form with dummy data, so I created a bookmarklet to fill the forms in with garbage.

I've only used this in firefox, and it assumes that prototype.js is loaded on the page you're using. Furthermore, it only fills in textarea, input text, and radios. Very niche! I just am putting it up here because otherwise I'll lose it and have to spend 10 minutes of my life writing this code again.

javascript:$$("input[type=text], textarea").each(function(f){ f.value = + " random value"}); $$("input[type=radio], input[type=checkbox").each(function(f) { f.checked = true }); undefined

Similarly, here's a bookmarklet to clear forms:
javascript:$$("input[type=text], textarea").each(function(f){ f.value = ""}); $$("input[type=radio], input[type=checkbox").each(function(f) { f.checked = false }); undefined
Tags: bookmarklet, code, computers, for me, javascript, nerdcore, software

  • My tweets

    Mon, 08:57: RT @ thomdunn: New inspiration just dropped

  • My tweets

    Fri, 23:43: RT @ TheParkerJam: Have any fellow EST @ Fusion fans been following this year? Between new time zone and the gaps between games, I…

  • My tweets

    Fri, 10:53: RT @ TheParkerJam: I can now say I'm in an Among Us YouTube video that has features Kimi, Ellum, and Chilled. 🤯(OK, it's a…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.