The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help getting a form submission button to work
Legalnonsense
post Feb 11 2019, 02:54 PM
Post #1





Group: Members
Posts: 2
Joined: 11-February 19
Member No.: 26,821



Hey folks,

I'm totally new here, and way over my head. Disclaimer: I have taught myself a little html for a work project over the last two weeks so someone here can create forms that are ADA compliant. As I get to the final step, I've realized that I cannot for the life of me get "submit" button to work. Ideally the button would automatically send all the relevant information in the document to my email address to be reviewed.

I've tried a few variations along the lines of

<form action="/action_page.php" method="get" id="form1">
</form method="post"action="mailto:myemail@website.com">
<input type="submit" value="Send Email"/>
</form>

But nothing has gotten to work. At one point I was able to send an email to myself through this but the email was blank and didn't include any part of the form.

So, I'm totally lost, I've been looking at guides online but can't seem to find anything that works.

Any help would be appreciated.

Thanks friends

P.S. If it helps, the rest of the documented is formatted like:

<h2><b>PERSONAL INFORMATION</b></h2>
<table>
<tr>
<td>
Last Name
</td>
<td>
<input type="text" name="">
</td>
</tr>
<tr>
<td>
First Name
</td>
<td>
<input type="text" name="">
</td>
</tr>
</table>

Ultimately, the code I've "borrowed" (stolen) from other how-to guides aren't from the same place I got this format from. As such, I don't know if that's the reason why I'm not able to get this to work.

Thanks again for reading.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 11 2019, 03:49 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You can only have one start tag for FORM. You have two. And the second one starts with a closing slash. You can only have one method attribute. Since you have two form tags you have to method attributes with different methods. IIRC GET should be used for mailto, not POST.

But this is confusing. Do you have a script to handle the form and send you an email? You have action_page.php in the first form tag. If so, you should configure that script to use your email address, not enter it in the form itself.

If you don't have a script, you may consider to get one. Mailto is inherently unreliable. There must be an email client on the system and the browser must be configured to evoke it.

Nowadays a lot of people use only webmail. Mailto doesn't work.
Someone uses a computer at school or a library. There won't be an email client.
Someone uses a friend's computer or another family member's. There may be an email client but it won't have an account for the user's email address.

If you do this just for fun and nothing important, then mailto is OK. But it won't work until you remove the first FORM tag and remove the slash from the one with mailto.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Legalnonsense
post Feb 11 2019, 03:53 PM
Post #3





Group: Members
Posts: 2
Joined: 11-February 19
Member No.: 26,821



QUOTE(pandy @ Feb 11 2019, 03:49 PM) *

You can only have one start tag for FORM. You have two. And the second one starts with a closing slash. You can only have one method attribute. IIRC GET should be used for mailto.

But this is confusing. Do you have a script to handle the form and send you an email? You have action_page.php in the first form tag. If so, you should configure that script to use your email address, not enter it in the form itself.

If you don't have a script, you may consider to get one. Mailto is inherently unreliable. There must be an email client on the system and the browser must be configured to evoke it.

Nowadays a lot of people use only webmail. Mailto doesn't work.
Someone uses a computer at school or a library. There won't be an email client.
Someone uses a friend's computer or another family member's. There may be an email client but it won't have an account for the user's email address.

If you do this just for fun and nothing important, then mailto is OK. But it won't work until you remove the first FORM tag and remove the slash from the one with mailto.


Thanks, just noticed that. Ideally what would happen is when a user hits submit, I would receive an email with all of the information from the fields the user filled out (there's a fair amount of excess fields in the form). I'll look into finding an alternative for Mailto.

Thanks a lot.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 11 2019, 03:57 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You may have misunderstood what mailto does. It doesn't magically send an email. It just evokes an email client (in best case) with the fields already filled in. The user still needs to manually send the email and he can edit the content to his heart's content.

If you want magic you need a script on the server. wink.gif
There are ready made scripts for this, many of them free. It's usually a no-brainer to use them. But this kind of scripts are also risky. Some are insecure and can be used by spammers. Not for spamming you, but, much worse, to use your server to send their spam from. And you take the blow.

I don't know what scripts are recommended nowadays, so I won't suggest any. Just be careful and try to find some kind of reviews of the ones you are interested in.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 11 2019, 04:57 PM
Post #5


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Feb 11 2019, 09:57 PM) *

I don't know what scripts are recommended nowadays, so I won't suggest any. Just be careful and try to find some kind of reviews of the ones you are interested in.

The webhost may already offer one, look in the support pages.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 08:45 AM