Results 1 to 3 of 3

Thread: Help in adding a Browse button

  1. #1
    Join Date
    Apr 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help in adding a Browse button

    By chance does anyone know a code to add to a form where I can have people attach a pic or doc to it??? I found one but I cant get it to work???? Please help

    <FORM action="mailto:howdmbhp@yahoo.com">
    Name: <INPUT name="Name" value="" size="35"><BR>
    Email: <INPUT name="Email" value="" size="35"><BR>
    Address: <INPUT name="Address" value="" size="35"><BR>
    Phone: <INPUT name="Phonel" value="" size="35"><BR>
    <FORM METHOD="post" ACTION="mailto:howdmbhp@yahoo.com" ENCTYPE="multipart/form-data">
    Attachment: <INPUT TYPE="file" NAME="attachedfile" MAXLENGTH=99 ALLOW="text/*" >
    <INPUT TYPE="submit">
    </FORM>

    Thank you =)

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    There are a few issues with the markup you posted. One is relatively minor. The others are not.

    Quote Originally Posted by howd
    <FORM action="mailto:howdmbhp@yahoo.com">
    The use of mailto URLs in forms is notoriously unreliable. In order for them to work, two requirements must be met:

    1. The user needs to have configured a default mail client, capable of delivering messages to an SMTP server.
    2. The user needs to have configured their user agent to associate mailto URLs with the mail client.
    Neither of these is a given. I know someone who would be incapable of fulfilling the first as his ISP uses some awful Flash-driven mail system. It's not an application, so it can't be associated with any actions. Similarly, what of people who use Hotmail, or other Web-based systems?

    No. Never use mailto URLs with forms. I'll suggest what is about the only reliable alternative in a moment.

    <FORM METHOD="post" ACTION="mailto:howdmbhp@yahoo.com" ENCTYPE="multipart/form-data">
    You cannot nest form elements. It is forbidden, and how any particular user agent handles this situation is undefined. It might do what you want, but it probably won't.

    <INPUT TYPE="file" [...] ALLOW="text/*" >
    Two things here.

    1. There's no such thing as an allow attribute on input elements. Anywhere in HTML, in fact. However, there is an accept attribute which can contain a comma-separated list of media types.
    2. If you want someone to upload images or documents (and I suppose you mean MS Word), limiting the media type to subsets of text is not the way to go about it. Images have their own type (image), and proprietary word processor formats will almost certainly be application types. I'm not sure if user agents actually use this attribute, but you'd have problems if they do. In other words: don't use it here.
    So, what is the alternative? A form processor hosted on a server. A user could send a message and upload any data to a server. The server can then construct an e-mail and send it to your address. There are lots of free, remotely-hosted form mail services, and some of them do support file uploads. If you have problems once you've selected a service, you'd be better off asking that particular provider. However, feel free to ask general questions here.

    Hope that helps,
    Mike

  3. #3
    Join Date
    Apr 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank you

    Thank you very much for all your help. I'll check it out and try it. Again Thank you. Tiffaney =)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •