Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2009
    Posts
    25
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Javascript Form and Send Button

    Hi there,

    I guess my question is very novice but I have to ask it.

    I can find lots of "form applications" on internet. But anytime I check them I cannot see any "send" button help. I mean I know that when I click it, it wont send the informations to my e-mail page. Because they don't show where to insert my email address there, in the example.

    So how can we make a form work for us, how can we arrange it to send the informations to our e-mail address? Do we need to use a php file for it? if yes, how?

    Regards and Thanks in advance

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,920
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Here is a simple example:-

    Code:
    <html>
    <head>
    </head>
    <body>
    <h1>Form Example</h1>
    Enter the following information. When you press the Submit button,
    the data you entered will be sent by email.
    <form name="form1" action="mailto:me@mydomain.com"  enctype="text/plain" method="POST">
    <p><b>Name:</b> <input TYPE="TEXT" SIZE="20" NAME="yourname">
    </p>
    <p><b>Address:</b> <input TYPE="TEXT" SIZE="30" NAME="address">
    </p>
    <p><b>Phone: </b> <input TYPE="TEXT" SIZE="15" NAME="phone">
    </p>
    <p><input TYPE="SUBMIT" VALUE="Submit"></p>
    </form>
    </body>
    </html>
    However, the trouble with using this method (mailto) to send form results is its unpredictability. The method it is highly dependent on the browser in use and the email client in use (some people have only Yahoo or Hotmail). In particular, your visitor must have Outlook or Outlook Express as the default client for this to work correctly. Even if your visitor is using Internet Explorer, but the default mail client is different (e.g. Eudora), your mailto form will not work. With all of the browser troubles, you're likely to lose about half of your users' messages. Most of the email clients that can successfully send a mail will prompt the user by a security dialog prior to sending - this can scare many users from continuing.
    Another problem is that it is not possible to control the formatting of the form data.

    If you are going to use a form then use a server-side formmail script as the action - there are several good free ones out there.

    For a simple PHP form feedback script see:- http://www.thesitewizard.com/archive/feedbackphp.shtml

    Quizmaster: What was the principal language spoken by the ancient Romans?
    Contestant: Greek
    Last edited by Philip M; 12-30-2010 at 12:20 PM.

  • Users who have thanked Philip M for this post:

    may_bailey (12-30-2010)

  • #3
    New Coder
    Join Date
    Aug 2009
    Posts
    25
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thank you very much for your help. I will check the web site you suggested and will have to re-shape it as my form blanks. (I have to insert some drop down choice options, too) and then, I can inform you how successful I will be.

    By the way I will use it to send the form informations to my own hosting email accounts.

    Regards


  •  

    Posting Permissions

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