- Forums
- Javascipt
- Javascript Make Submit Button Go
This Page Will Explain How You Can Make Html Code To Make A Form Submit With A Button Using Javascript [2193], Last Updated: Mon Jun 24, 2024
Webune Tutorials
Sun Dec 20, 2009
2 Comments
403 Visits
Welcome to Webune Support Forums - We provide web hosting to people just like you who are just begining to program their websites. We provide excellent support service, that is why we have created this post to show you how you can make a form submit when you hit the submit button but using Javascript instead of the HTML submit button, why do this, because this will help some with robots and perhaps help you in preventing spam on your posting. for example, with the normal submit submit button, i noticed i get a lot of spam messages, but my spam has cut down after implementing javascript.
this is an example of a typical submit button form:
HTML FORM
<form action="" method="post" name="Form1" target="_blank">
<input name="Submit" type="submit" value="Submit" />
</form>
now you can do the same with this form but using javascript, it will submit the form when you click on the button
FORM USING JAVASCRIPT
<form action="" method="post" name="Form1" target="_blank">
<input name="Submit" type="button" value="Submit" onClick="submit();"/>
</form>
try it yourself,
what makes all this work is this:
onClick="submit();"
hope that helps