hi
I don't have access to the HTML code, only the JavaScript code.
I want the "submit" button(s) to become disable when a user submits a certain form called "mform1"
submitWait() (code bellow) seems to work only for FireFox but not for IE8.
"this" seems to have no properties in IE8 at submitWait()
suggestions ?
here is the HTML code:
here is the the Javascript code:HTML Code:<form id="mform1" name="mform1" enctype="multipart/form-data" method="post" > <input type=file><br /> name: <input type="text" ><br /> <input type="button" value="just a button"><br /> <input type="submit" value="submit" value="submit"><input type="submit" value="submit and view"> </form>
Code:if (window.addEventListener){ window.addEventListener('load', attachFormSubmit, false); } else if (window.attachEvent){ window.attachEvent('onload', attachFormSubmit ); } function attachFormSubmit(){ theForm = document.getElementById("mform1"); if (theForm.addEventListener){ theForm.addEventListener('submit', submitWait, false); } else if (theForm.attachEvent){ theForm.attachEvent('onsubmit', submitWait); } } function submitWait(){ if (document.all || document.getElementById) { for (i = 0; i < this.length; i++) { var formElement = this.elements[i]; if (formElement.type == "submit") { formElement.disabled = true; } } } }



Reply With Quote


Bookmarks