form function that prevents form.submit() code example Example: javascript prevent form submit <form name="foo" onsubmit="return false">