how to submit form by javascript and preventdefault code example Example: javascript prevent form submit <form name="foo" onsubmit="return false">