agthepeot
11-29-2002, 01:18 PM
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
|
Click to See Complete Forum and Search --> : emailing a forms answer agthepeot 11-29-2002, 01:18 PM 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 gil davis 11-29-2002, 01:40 PM 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> agthepeot 11-29-2002, 01:56 PM 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)? AdamGundry 11-30-2002, 04:00 AM 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 webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |