auto-filling and submitting forms

in Script development
Subscribe to auto-filling and submitting forms 4 posts, 2 voices



hailcrest User
FirefoxWindows

so, my teacher frequently forces us to do these pointless true/false quizzes more often than i'd like and there are always nearly 50 questions per quiz.

right now, i'm using a javascript injection bookmark to do it:

javascript:(function(){var radios = document.getElementsByTagName("input");for (var i = 0; i < radios.length; i++) {if (radios[i].type === "radio" && radios[i].value === "true") {radios[i].checked = true;}}})();document.forms[1].submit();

but when i copypaste this into a userscript (for even more convenience), it doesn't work.

anyone can help me out?

 
mike cupcake Scriptwright
FirefoxWindows

you need to remove: javascript:(function(){

and its corresponding closing brackets towards the end: })

 
hailcrest User
FirefoxWindows

i did that, but still didn't work.

so i tried removing the () after checked = true, and it worked.

thanks for the help!

 
mike cupcake Scriptwright
FirefoxWindows

ah yes, glad you've got it working.

(sorry, I keep clicking Flag Spam instead of Reply!)