Need advice on submitting an online form please!!

Associate
Joined
1 Jan 2007
Posts
355
Hi everybody,

Please bare in mind I am new to coding & is something I am currently studying but I have hit a slight problem whilst designing an online form for an intranet site.

I have designed & layed out the form the way I want it to look which is pretty straight forward.

However, what I want to achieve is when somebody completes the online form & hits the submit button I then want the form data to be sent to an email address of which I have included the following coding:

<form method="post" action="mailto:[email protected]" enctype="text/plain">

The email address is obviously a made up one for example purposes.

Ok. Now the problem I have is that when the form is completed & is submitted the browser then tries to open another window of which then comes up with the syntax "Not connected to internet" because it's trying to find a page called "[email protected]".

How do I stop it trying to open a new window?

I just want the user to click on submit of which a message briefly appears saying "Form submitted" then returning back to the form giving the user the option to clear down & complete a new one.

Any advice would be appreciated.

Thanks.
 
hey

you are going to need to use something like php's mail() to get this working.

You can pass the $_POST variables to the $body attribute and basically make it plain text or html depending on what you want.

The mailto: thing is client side only, and relies on the person clicking having a mail client setup
 
Hi Mort,

Thanks for the quick reply.

Please forgive me but I really haven't even started studying PHP yet so the link you provided I am struggling to really understand what I need to insert & where to my html document for it to do what I want.

PHP is certainly something I need to study I know but at the minute I am just after a simple paragraph of coding I can insert into my document which will pop up with a brief message to say the form has been submitted then return the user back to the form page.

Ideally as well I would like the form information to be sent in a plain text format via email without an attachment as at the minute the attachment is a .att file.

I hope this makes sense.

Thanks again.
 
As Mort said, you can't do this in just HTML since mailto is client side only. Mailto will only work when you have an account setup in Outlook or a similar mail client.

PHP Mail() is the way to go and and is very easy to pickup, since there are tons of examples that can easily be found on Google.
 
Hi Kinneh,

This isn't a problem because everybody that is using the intranet site is using Outlook express so the "mailto:" element should be fine.

However, what I have found strange is that when I submit the online form using my desktop which is using Windows mail (Vista) this seems to work fine except it's opening a new window which I need to address but I am receiving the form results fine via email. Now, when I complete the online form using my laptop which is using Microsoft Outlook as default when I click submit it opens Outlook & starts to compose a new message & doesn't send the form.

Any ideas why this could be?

Also, am I correct in saying that to display a confirmation message the form has been sent I would need to create an html document quoting "Your form has been sent" then have the url for this html file associated with the "Form method" element so it knows to point to this page once the form has been submitted?

I hope i'm making sense.
 
if you want the confirmation and no new window opening then you deffo need to go the PHP route. I presume your intranet is hosted on some sort of internal webserver?

the way you are doing it now will rely on the user waiting for the new email window, and pressing send for it to work
 
Back
Top Bottom