Why return false, the sequel?


#1


@ zystvan

With reference to the earlier post, Why return false, on this project's board...

For my clarity, are you saying that the submit() method would be triggered when the DOM is ready own its own without having a user click on the input element's submit button?


Replace this line with your code.


#2

Butting in, on the second question, and leaving Zeke to field the first...

Can only be triggered one way... click a type="submit" input object. We could theoretically have a form prepopulated at load time, and in the ready handler trigger a submit event. That would cause the form to be submitted as though the button was clicked. What point it would serve is another question.


#3

@jnl2 Are you referring to this topic? I don't see any references to returning anything in there. In this case, I suspect return false is being used to prevent the page from reloading after you submit the form.

are you saying that the submit() method would be triggered when the DOM is ready own its own without having a user click on the input element's submit button?

No, I don't think so. When the form gets submitted, if it reloads the page then all of the modifications you made to the DOM will now be lost since the (in this case, virtual) browser pulls in the HTML file, which you didn't change.

Does this answer your question?


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.