W-DOGG Posted November 2, 2005 Share Posted November 2, 2005 See the following code: function form_parser(){ var fz = true; var fy = 0; do { if(document.getElementsByTagName("form")[fy]){ if(!document.getElementsByTagName("form")[fy].onsubmit){ //have put an alert box here to check document.getElementsByTagName("form")[fy].onsubmit = "return false;"; } fy = fy + 1; }else{ fz = false; } } while(fz); return; } As you can see, or not, this line should make any form without an onsubmit expression return false and cancle the submission: document.getElementsByTagName("form")[fy].onsubmit = "return false;"; the function gets executed, and, when I put in an alert box to check if it actually reaches the forms without onsubmit it comes up with a box. still when I submit the form it DOES submit, and somehow it doesn't get cancled. anyone know more about this? ta Link to comment Share on other sites More sharing options...
Question
W-DOGG
See the following code:
As you can see, or not, this line should make any form without an onsubmit expression return false and cancle the submission:
the function gets executed, and, when I put in an alert box to check if it actually reaches the forms without onsubmit it comes up with a box.
still when I submit the form it DOES submit, and somehow it doesn't get cancled.
anyone know more about this?
ta
Link to comment
Share on other sites
0 answers to this question
Recommended Posts