I know that the onsubmit event occurs when a form is submitted.
Generally, we are calling a method on the onsubmit event, like <form action="" onsubmit="myfunction()">
.
Today I saw this, "<form action="" onsubmit="return false">"
. How does it work? I could not understand what is the meaning of onsubmit="return false"
.
PS: I found this when learning Ajax. It was a tutorial which explains how to submit data to a database without refreshing the page.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…