1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Rep Power
    I give documents to download on my site, but I like the users to give me some info before. Until now I used CGI but I changed host, so I wish to use Javascript now.

    I got this script (below) from Codelifter which is great, but I don't know how to have it send me the result (content of the form)in addition to sending the user to the download page (URL, which the script does already).

    This is probably pretty easy, but I just can't figure it out

    Help !

    Here is the complete script I got (everything goes in the body section) :


    <font size="2" face="Arial" color="#FF0000">
    <form name="TheForm">
    <input type="text" name="nm" size="33"> Your Name
    <input type="text" name="em" size="33"> E-mail address
    <input type="text" name="emx" size="33"> Re-enter to confirm
    <input type="button" value="Submit" name="SB" onClick="sendOff();">

    <script language="JavaScript1.2">

    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this header

    var good;
    function checkEmailAddress(field) {

    // Note: The next expression must be all on one line...
    // allow no spaces, linefeeds, or carriage returns!
    var goodEmail = field.value.match(/b(^(S+@).+((.com)|(.net)|(.edu)|(.mil)|(.gov)|(.org)|(..{2,2}))$)b/gi);

    if (goodEmail){
    good = true
    } else {
    alert('Please enter a valid e-mail address.')
    good = false

    function sendOff(){
    nmcheck = document.TheForm.nm.value
    if (nmcheck.length <1) {
    alert('Please enter your name.')
    good = false
    if ((document.TheForm.em.value ==
    // This is where you put your action
    // if name and email addresses are good.
    // We show an alert box, here; but you can
    // use a window.location= 'http://address'
    // to call a subsequent html page,
    // or a Perl script, etc.

    window.location= 'http://www.chez-pierre.net'
    if ((document.TheForm.em.value !=
    alert('Both e-mail address entries must match.')


    How do I add my Email adress to get the results of the form ?

    Thanks in advance !

    Pierre )

  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    What host are you with? Do they not have any server side options such as asp or php?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Rep Power
    No, no server side right now on "Le Village". They plan on adding PHP and MYSQL but there is no date given...

    So that's why I wish to use JavaScript

    Can you help ?

    Thanks !

    Pierre )

Similar Threads

  1. From Front Page form, send to database AND email
    By kbrooks in forum ASP Programming
    Replies: 11
    Last Post: January 19th, 2009, 04:50 PM
  2. From form, send to database AND email
    By kbrooks in forum HTML Programming
    Replies: 5
    Last Post: September 30th, 2003, 02:35 PM
  3. send confirmation email from ASP form
    By whyzz in forum ASP Programming
    Replies: 3
    Last Post: July 22nd, 2003, 08:51 PM
  4. get checkbox comparison value and send email
    By dbosz in forum PHP Development
    Replies: 0
    Last Post: April 24th, 2003, 02:10 AM
  5. how to email form info back to user
    By elaineshuman in forum Perl Programming
    Replies: 3
    Last Post: February 7th, 2003, 09:23 PM

IMN logo majestic logo threadwatch logo seochat tools logo