dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: emailing a forms answer

  1. #1
    Join Date
    Nov 2002
    Posts
    3

    emailing a forms answer

    Hello Im new at javascript, does anybody know how to make a form with 1 question and a "submit" button, and when they click submit it emails the answer to a specified email? agthepeot2002@yahoo.com

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    You do not need JavaScript to do that. You should take an HTML tutorial.

    <form action="mailto:someone@somewhere.com">
    What is your name, please? <input type="text" name="subject"><br>
    <input type="submit" value="submit">
    </form>
    Last edited by gil davis; 11-30-2002 at 01:15 AM.

  3. #3
    Join Date
    Nov 2002
    Posts
    3

    hey

    I posted in in an html file of mine like this:

    <form action="mailto:agthepoet2002@yahoo.com">
    What is a number? <input type="text" name="question"><br>
    <input type="submit" value="submit">
    </form>

    but when i pushed submit, nothing happened, and it didn't email me. Could I get the code so they click a link that "pops" up the code for 2 questions, and when you hit submit it emails me the answers and closes the box (like an alert box or something)?

  4. #4
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    First you need to design the page for the popup window with the questions. The code above should work on all browsers, though it may pop up a warning box. Alternatively, if Perl is available on your host, try here:

    http://www.scriptarchive.com/formmail.html

    Once you have the working page, put in the code "window.close()" in an appropriate event handler (onSubmit for the code above, in the returned page for the FormMail script).

    In the page you want to have a popup hyperlink, use this code:

    <a href="javascript:void(window.open('http://www.location.com','Popup','Height=200,Width=200'))">Click here to open window</a>

    This creates a popup window of www.location,com, height 200px, width 200px.

    Cheers

    Adam

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles