www.webdeveloper.com
Results 1 to 2 of 2

Thread: Please help me save time!

  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Smile Please help me save time!

    While I usually frown on javascript injection, I am in need of its benefits. Everyday I must fill out the same stupid evaluation, which consists of 15 yes/no radio buttons.

    Basically, I would like to have a java script injection that works in the url bar that would select all of the yes radio buttons on this evaluation.

    Both yes and no radio buttons have the same name, but obviously different values). The name of each element is incremented up by 1 each time.

    (no predefined ids)

    Please help me!

  2. #2
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    Assuming the radio buttons have a value of 'yes':

    Code:
    javascript:AE=document.getElementsByTagName('input'); for( var i in AE )if(AE[i].type=='radio'&& /\byes\b/i.test(AE[i].value))void(AE[i].checked=true)
    Where used, return should be executed unconditionally and always as the last statement in the function.

    That's my signature, it's not part of the damn post!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles