User Script to Remove Reset Buttons

    _   _              _    ___  _            _     _                  _
   /_\ | |_ __  ___ __| |_ / _ \| |__ ___ ___| |___| |_ ___   _ _  ___| |_
  / _ \| | '  \/ _ (_-<  _| (_) | '_ (_-</ _ \ / -_)  _/ -_)_| ' \/ -_)  _|
 /_/ \_\_|_|_|_\___/__/\__|\___/|_.__/__/\___/_\___|\__\___(_)_||_\___|\__|
                                                   In Glorious ASCII-VISION
Home

2011-04-13 Wed User Script to Remove Reset Buttons

CLICK HERE TO INSTALL

A user script to remove the reset buttons from HTML forms on all sites.

Made in response to this thread on HN

Source code

// ==UserScript==
// @name          No Reset Buttons!
// @author     Thomas Parslow (tom@almostobsolete.net)
// @namespace     http://almostobsolete.net/
// @description   Remove reset buttons from forms!
// @include       *
// ==/UserScript==

function no_reset_buttons_please() {
    var reset_buttons = document.getElementsByTagName("input");
    for (var i=0; i < reset_buttons.length; i++) {
        var element = reset_buttons[i];
        if (element.getAttribute("type") == "reset") {
            element.parentNode.removeChild(element);
        }
    }
}
no_reset_buttons_please();
 __________________
< made in Org-mode >
 ------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                |   | ----w |
                 ||     ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Author: Thomas Parslow

Date: 2011-04-13 12:13:57 BST

HTML generated by org-mode 7.01trans in emacs 23