I'm using the following code to remove submit inputs after they have been clicked to stop double form processing.
I don't really know very much about js, but i think that i am supposed to name the forms which i wish it to work on, as "r".
The problem is, what if i want every submit input on a page to dissappear, but they are in different forms? I have tried naming them all as "r" but only the submit inputs inside the form that i click an inout from, will dissappear.
Thanks in advance for any help, and please correct me if i have gone totally wrong with my understanding of the above code.
Code:
gg=false; function di(r) { for (i=0;i < r.elements.length;i++) { if (r.elements[i].type=='submit') r.elements[i].style.visibility='hidden'; } if(gg==false) { gg=true; return true; } else return false; } function grabit() { for(i=0;i < document.forms.length;i++) document.forms[i].onsubmit = function() {return di(this);}; }
The problem is, what if i want every submit input on a page to dissappear, but they are in different forms? I have tried naming them all as "r" but only the submit inputs inside the form that i click an inout from, will dissappear.
Thanks in advance for any help, and please correct me if i have gone totally wrong with my understanding of the above code.
Comment