+ 1

Button Submit HTML

I created a button for submitting the form, rather than just submitting the form, it opens a request to send email, or opens my email agent, how to make this button just submit form?

1st Aug 2017, 11:34 PM
Gabriel Alexandre Vieira
Gabriel Alexandre Vieira - avatar
9 Answers
+ 10
onsubmit can link this to Javascript to run some code
2nd Aug 2017, 2:27 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 5
If you have additional questions after @DEVIL's answer, can you post your code in CodePlayground?
2nd Aug 2017, 1:47 AM
Kirk Schafer
Kirk Schafer - avatar
+ 5
If your submit button open email agent or such kind of email sending request behaviour, you've probably fill the 'action' attribut of your <form> (or of the button itself) with an url with the prefix 'mailto:' rather than 'http:'... Anyway, don't forget that to submit form data, you need a server sided service to receive them ^^
2nd Aug 2017, 2:20 AM
visph
visph - avatar
+ 5
Public POST test - it just echoes the fields you send it. http://www.hashemian.com/tools/form-post-tester.php
2nd Aug 2017, 2:24 AM
Kirk Schafer
Kirk Schafer - avatar
+ 5
Your form is quite incomplete (lot of tags not closed) and messy, and the 'action' attribute contains an email url (starting with 'mailto:')... Replace the 'action' attribute with a real url (not a 'mailto:' prefixed one, if you don't want that user manually send form data by mail -- the one suggested by @Kirk Schafer is working ^^), but clean your html, by correctly close the tags at least, if not better structure your form: http://www.hashemian.com/tools/form-post-tester.php (Annoted code to long for post ^^)
3rd Aug 2017, 5:17 AM
visph
visph - avatar
+ 2
@DEVIL don't forget the quotes. <input type="submit" value="submit here">
2nd Aug 2017, 2:14 AM
God Usopp
God Usopp - avatar
+ 1
<input type=submit value=submit here>
1st Aug 2017, 11:37 PM
DEVIL
DEVIL - avatar
- 1
Good Evening, i am yong padawan in sololearn hehe, i get link of playground with part of my code, contains my answer, my inglish is not good, a im Brazillian hehe. https://code.sololearn.com/WXCG10s0ziMD/#
2nd Aug 2017, 10:02 PM
Gabriel Alexandre Vieira
Gabriel Alexandre Vieira - avatar
- 1
@visph It is a part of code, Just part of code.
3rd Aug 2017, 10:34 AM
Gabriel Alexandre Vieira
Gabriel Alexandre Vieira - avatar