• 0

problem regarding onsubmit


Question

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

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.