Jump to content
Martin54

Contact Form.

Recommended Posts

Hello

I'm using one of w3 schools responsive templates to build my site. I've put in a contact form but I'm not sure if it's responding correctly?

An e mail box does pop up but no name of sender or email address of sender, nor any message. I've attached screen shots, if anyone can confirm where I'm going wrong that would be much appreciated.

Many Thanks

Martin

Screen Shot 2018-01-23 at 16.27.16.png

Screen Shot 2018-01-23 at 16.29.42.png

Screen Shot 2018-01-23 at 16.30.28.png

Share this post


Link to post
Share on other sites

The mailto protocol doesn't provide a way to set the "From" address. It lets you set the subject and body. In order to do that, you have to give the inputs the correct name attribute: <input name="subject"> for the subject, <input name="body"> for the body.

If you want more sophisticated mail functionality you're going to have to work with server-side programming.

Share this post


Link to post
Share on other sites

Hello Ingolme

Thanks for getting back to me and sorry for the delay in replying.

I'm very new to all this coding, so it takes a while to get my head around the language.

I'll take a look at your suggestion tomorrow and get back to you.

Share this post


Link to post
Share on other sites

Hello Ingolme

I've tried your suggestion but unsurprisingly it doesn't work, which is more likely, me not putting it in the correct place?

Are you able to be more precise on where it actually goes, are you able to mark my screen shot?

It seems slightly surprising, if w3 schools are offering templates with contact forms already in place, that that information isn't in place or maybe it is but my inexperience fails to see it, doh!

 

Thanks for any further help.

Share this post


Link to post
Share on other sites

You don't add subject as input, but as a querystring

mailto:someone@example.com?subject=somthing%20to%20do%20with%20mailto&body=what%20the%20hell" in form action.

Share this post


Link to post
Share on other sites

If the form's method is GET and the input matches the correct query string parameter then a form can be used because the form generates the query string.

Share this post


Link to post
Share on other sites

Hello dsonesuk and Ingolme

 

Thanks for your replies and feedback, much appreciated.

I'll get onto it tomorrow and let you know how I get on.

Thanks

Martin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×