kevbaz Posted December 7, 2010 Posted December 7, 2010 Hi Guys, im trying to create a web based toner request form, i have the form created and am using mailto to have the form submitted by email, however upon clicking the submit button its only creating a blank email? how do i go about getting it to include the contents of the form? thanks
powdarrmonkey Posted December 7, 2010 Posted December 7, 2010 Just a mo while I fetch the crystal ball...
CESIL Posted December 7, 2010 Posted December 7, 2010 Are you setting the form to GET or POST? I think only POST will do what you want. A better way to handle this would be to send the form data to a script that build the email and sends it through sendmail. That way you get more control of the data and can format it properly. 1
webman Posted December 7, 2010 Posted December 7, 2010 Are you doing everything that this page tells you to? Mailto Forms - HTML Forms Tutorial - Using Mailto Forms 1
kevbaz Posted December 7, 2010 Author Posted December 7, 2010 Are you doing everything that this page tells you to? Mailto Forms - HTML Forms Tutorial - Using Mailto Forms Just looked that that and im setup the same, ive copied the example and tested it and it does exactly the same??? just opens a blank email?
powdarrmonkey Posted December 7, 2010 Posted December 7, 2010 Perhaps I didn't make it clear enough: show the code.
kevbaz Posted December 7, 2010 Author Posted December 7, 2010 Win7 IE8 Office2010 Marine Academy Toner Request top.png Marine Academy Toner Request Marine Academy Toner Request http://www.marineacademy.org.uk/sites/default/files/simply_modern_logo.png Name First Last Date / MM / DD YYYY calendar.gif Calendar.setup({ inputField : "element_2_3", baseField : "element_2", displayArea : "calendar_2", button : "cal_img_2", ifFormat : "%B %e, %Y", onSelect : selectDate }); Toner HP2600 Black £55 HP2600 Cyan £58 HP2600 Yellow £58 HP2600 Magenta £58 Please select the toner you require Location Budget Approved by budget holder? No Yes bottom.png
localzuk Posted December 7, 2010 Posted December 7, 2010 (edited) Mailto makes use of your email client, and as such is generally a bad way of doing email notifications. The more elegant solution is to make use of a server side script which creates the email and sends it. Due to the fact the mail client is the one handling the creation of the email, the issue you're having could well be with that rather than your form. Also, each browser is likely to handle the form differently. For example, Chrome doesn't like GET for mailto forms, and IE8 doesn't particularly like POST for mailto forms, so you'll end up with mixed results! Edited December 7, 2010 by localzuk 1
powdarrmonkey Posted December 7, 2010 Posted December 7, 2010 (edited) A load of your inputs have a blank space when declaring their name. This results in them not being defined. Edited December 7, 2010 by powdarrmonkey
localzuk Posted December 7, 2010 Posted December 7, 2010 A load of your inputs have a blank space when declaring their name. This results in them not being defined. I can't see any with spaces. I can see many with underscores...
CESIL Posted December 7, 2010 Posted December 7, 2010 There is a space between the '=' and the first "
powdarrmonkey Posted December 7, 2010 Posted December 7, 2010 I can't see any with spaces. I can see many with underscores... element_1_1 element_1_2
CESIL Posted December 7, 2010 Posted December 7, 2010 The more elegant solution is to make use of a server side script which creates the email and sends it. Is there an echo in here
powdarrmonkey Posted December 7, 2010 Posted December 7, 2010 Anyway, the problem is easy (now that you don't expect psychic assistance): you don't have an input named "body", which should be type text and becomes the body of the email. All your fancy inputs are wasted.
CESIL Posted December 7, 2010 Posted December 7, 2010 element_1_1 element_1_2 I still don't see any spaces
CESIL Posted December 7, 2010 Posted December 7, 2010 o rly? [ATTACH=CONFIG]8836[/ATTACH] Oh, now you have posted the code I can see you mean. BTW I have already posted that the form (with it's 'fancy' inputs) does work but not reliably due to the GET/POST issues that both myself and others have pointed out. A mail handling script is the best way to resolve this. 1
kevbaz Posted December 7, 2010 Author Posted December 7, 2010 thanks for all the help, ive removed those spaces and have added and still no joy, ive never used a mail handling script at all before, infact im new to most of this and trying to learn the best i can, could somone post an example? im assuming id need to change the mailto and point it at a php script??
CESIL Posted December 7, 2010 Posted December 7, 2010 I have used this Worx International Inc. It might be easier than building your own 1
powdarrmonkey Posted December 7, 2010 Posted December 7, 2010 thanks for all the help, ive removed those spaces and have added No, you need to add but this does fix your problem.
kevbaz Posted December 7, 2010 Author Posted December 7, 2010 No, you need to add but this does fix your problem. Specifically where do i need to add this? thanks
powdarrmonkey Posted December 7, 2010 Posted December 7, 2010 Specifically where do i need to add this? thanks Anywhere you like between and , providing that doesn't result in invalid HTML.
kevbaz Posted December 7, 2010 Author Posted December 7, 2010 doing that seems to break it and stops the submit button from working? would you mind editing the code with this info added and reposting it for me?
powdarrmonkey Posted December 7, 2010 Posted December 7, 2010 doing that seems to break it and stops the submit button from working? would you mind editing the code with this info added and reposting it for me? This simple page illustrates the concept. Mailto submission </pre><form name="mailform" method="get" action="mailto:myaddress"> Requirements (include your name): </form><b 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now