prevent submit javascript w3school code example Example: javascript prevent form submit <form name="foo" onsubmit="return false">