prevent form from submitting with js only code example Example: javascript prevent form submit <form name="foo" onsubmit="return false">