Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buttonfix() {
- var buttons = document.getElementsByTagName('button');
- for (var i=0; i < buttons.length; i++) {
- if (buttons[i].onclick) { continue; }
- buttons[i].onclick = function () {
- for (j=0; j<this.form.elements.length; j++) {
- if (this.form.elements[j].tagName == 'BUTTON') {
- this.form.elements[j].disabled = true;
- }
- }
- this.disabled = false;
- var input = document.createElement('input');
- input.setAttribute('name', this.name);
- input.setAttribute('value', this.attributes.getNamedItem('value').nodeValue);
- input.setAttribute('type', 'hidden');
- this.form.appendChild(input);
- this.name = '';
- }
- }
- }
- window.attachEvent("onload", buttonfix);
Add Comment
Please, Sign In to add comment