PDA

View Full Version : form actions and email clients


mpclubfoot
06-25-2003, 05:33 PM
Hi all,

This is an extension of my last post. When testing either of the methods below, I've found that the results are different, depending on the default email client.

1. <form method=post enctype="text/plain" action="mailto:me@myaddress.com?subject=Method One">

2. <form method=post enctype="text/plain" action="" onsubmit="sendTo(this)">

And in an external .js file:
function sendTo(myform){
myform.action="mailto:me@myaddress.com?subject=Method Two">
}

If the default is Outlook, the mailto functions as one might suspect: the message is sent to the outbox with the address, subject and form fields and entries all in their proper places.

If the default is Yahoo, the mailto opens the client, puts the subject and the form fields and entries in the right place but doesn't put the address in the to line.

Being relatively new to forms, I find this rather confusing. Thinking back on the forms I have filled out in the past, I don't remember them ever opening my client, let alone not automatically sending my entries. Granted, before now, I've never looked closely at the source for a form so, I can't guarantee they were using the same method (or were even html forms, for that matter).

Why does this difference exist? Is there a way to make my forms work the same for all--or at least most--email clients? For reasons related to deadlines and abject laziness, I would like to keep the solution on the client-side, if possible.

arnyinc
06-25-2003, 06:46 PM
In a nutshell, these are the drawbacks of doing something client side. You always have people who are set up differently. All you can do is aim for the lowest common denominator or aim for the vast majority.

Basically all forms now are submitted to the server rather than via email. Client-side is messy, whereas server-side is cheap/free, more configurable, and easy enough for developers.

mpclubfoot
06-26-2003, 08:07 PM
I was afraid that was going to be the answer.

Thanks for the info!