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