A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Javascript Guru needed

  1. #1

    Javascript Guru needed

    Can Someone help me with this...I know it is not Flash related however I am teaching a class and comparing Flash against Javascript. The only thing I need to do is send the information to an email address not with cgi but with Javascript. This is my coding so far

    <html>

    <head>
    </head>

    <body bgcolor="#FFFFFF" text="#000080" link="#FF0000" vlink="#9F0000">
    <p align="center">
    <p align="center">&nbsp;</p>
    <script language="JavaScript">

    <!-- Begin
    var ans = new Array;
    var done = new Array;
    var score = 0;
    ans[1] = "c";
    ans[2] = "a";
    function Engine(question, answer) {
    if (answer != ans[question]) {
    if (!done[question]) {
    done[question] = -1;
    alert("Wrong!\n\nYour score is now: " + score);
    }
    else {
    alert("You have already answered that!");
    }
    }
    else {
    if (!done[question]) {
    done[question] = -1;
    score++;
    alert("Correct!\n\nYour score is now: " + score);
    }
    else {
    alert("You have already answered that!");
    }
    }
    }
    </script>
    <!-- STEP TWO: Put this code into the BODY of your HTML document -->
    <p align="center">&nbsp;</p>
    <!-- TWO STEPS TO INSTALL USER QUIZ: 1. Paste the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document -->
    <!-- STEP ONE: Copy this code into the HEAD of your HTML document -->
    <font size="6" face="Arial">
    <p>South Park Quiz #1</font><br>
    </p>
    <p><b>Objective: answer 7 questions correctly. JavaScript required!</b></p>
    <p><noscript>JavaScript is <i><b>disabled</b></i>. Get Netscape 3.0 or turn it on!</noscript> </p>
    <hr noshade>
    <FORM>
    <b><p>1. What is the name of the Newspaper Mr Garrison is reading at the quarry?</b></p>
    <p><input type="radio" value="a" onclick="Engine(1, this.value)">Time<br>
    <input type="radio" value="b" onclick="Engine(1, this.value)">Rolling Stone<br>
    <input type="radio" value="c" onclick="Engine(1, this.value)">RCKY MTN News<br>
    <input type="radio" value="d" onclick="Engine(1, this.value)">Spin</p>
    <p><b>2. Who is on the cover of the magazine?</b></p>
    <p><input type="radio" value="a" onclick="Engine(2, this.value)">Mr Hankey<br>
    <input type="radio" value="b" onclick="Engine(2, this.value)">Kenny<br>
    <input type="radio" value="c" onclick="Engine(2, this.value)">Cartman<br>
    <input type="radio" value="d" onclick="Engine(2, this.value)">Mr Hat</p>
    </FORM>
    <!-- Script Size: 5.64 KB -->
    <p><br>
    </body>
    </html>
    What I want to do is send an email of the result I.E. the score or the answer the user pick. Is this possible?

    Thank JuniorWil

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    As far as I know (I've never been forced to try) you can't automatically send an email without using cgi, cold fusion, or something like that. You might be able to access the body of a mailto: message. I know you can easily access the subject. Even if you do, the message will pop up and be editable by the sender like any mailto: link.

  3. #3
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    I did it - a few years ago (N4, IE3 and 4)
    <form action=mailto:.... method=post enctype=form/www-urlencoded>
    (not sure about correct spelling of enctye)
    When using N, this produced a mail with plain variables in the body of the message.
    Using IE (with outlook express installed) this sent a mail with the variables attached as a postdata.att file and a message "data brought to you by ...." in the sender's language.
    Using IE with outlook, or aol browser, there was a blank mailform -- and clients of course appreciated the fact that they were given a chance to enter their order again as plaintext

    I was really happy when I finally could get rid of that nonsense and run a cgi instead

    Musicman

  4. #4
    I know I could do it with cgi no prob but it is to be in an email with no direct link to a cgi the quiz must return the answer to the email box with no direct link to a cgi or php or asp

  5. #5
    Child Prodigy Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    551
    Code:
      hobby = webDesign; waitYears(3);
      job = webDesign; this.love(job);

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center