36 users online (0 members and 36 guests)  

Thread: JS Email Form


  Results 1 to 5 of 5

Related

  1. Need help with form going to email.    Forum: HTML Forum
    Replies: 1
  2. PHP Form email    Forum: PHP Forum
    Replies: 2
  3. Simple email form    Forum: HTML Forum
    Replies: 6
  4. Please help with email form script    Forum: PHP Forum
    Replies: 1
  5. PHP email form.    Forum: PHP Forum
    Replies: 2
  1. #1
    Bayleigh Anne's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2006
    Posts
    7

    JS Email Form

    I know this is probably a very easy question, but I literaly just started JavaScript, as in about 15 minutes ago. I have this code for an email form:

    <div align="center">
    <form action="#" method="post" onsubmit="return configureValidation(this)" onreset="confirm('All form information will be erased.')">
    <table class="formtable">
    <tr>
    <td>Name: <span class="required">*</span></td>
    <td><input type="text" name="firstname" value="" class="text"></td>
    </tr>
    <tr>
    <td>Email: <span class="required">*</span></td>
    <td><input type="text" name="email" value="" class="text"></td>
    </tr>
    <tr>
    <td>Your Website URL: <span class="required">*</span></td>
    <td><input type="text" name="firstname" value="" class="text"></td>
    </tr>
    <tr>
    <td>Comments:</td>
    <td><textarea name="comments" value="" class="text" cols="20" rows="4"></textarea></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit" name="submit" value="Send It" class="button"> <input type="reset" name="reset" value="Clear It"
    class="button"></td>
    </tr>
    </table>
    </form>
    </div>
    <p><div align="center">
    </div><p>
    Only problem is I can't figure out how to send it to my e-mail when they hit the submit button. If someone either wants to explain to me how to do this I would really appreciate it.

    Bailee

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: JS Email Form

    You cannot send email using javascript. What you can do instead is have the action button execute something like a Perl or PHP script.

    You might want to have a look at this page, as it gives you some alternatives. Hope it helps.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  3. #3
    Paco_Blanco's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    5

    Re: JS Email Form

    action="mailto:youremailaddress", method="post" and encType="text/plain" in your opening form tag(?).
    Last edited by Paco_Blanco; 05-14-2006 at 12:51 PM.

  4. #4
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: JS Email Form

    Quote Originally Posted by Paco_Blanco
    action="mailto:youremailaddress", method="post" and encType="text/plain" in your opening form tag(?).
    No.

    When a "mailto" link is visible in your source code, that's how spammers harvest your email address. You want something like this instead:

    Code:
    <form action="yourphpscript.php" method="post">
    where yourphpscript.php is the script that processes your contact form. That also conceals your email address from the spambots.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  5. #5
    Paco_Blanco's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    5

    Re: JS Email Form

    Good to know. Thanks.



Tags for this Thread