#1 (permalink)  
Old 12-19-2006, 05:21 PM
Registered User
 
Join Date: Dec 2006
Posts: 2
Javascript Code Question

I have created an online quiz using Quiz Maker 2.0. It uses a JavaScript Function in the <head> section to display a page of results when you click the submit button at the end of the quiz.
My question is, is there a way that the outputted HTML code (that the JavaScript Function creates) could be sent to my e-mail. If e-mail is not an option, what are other ways I can save this data?

It is a rather lengthy function, but if I need to I can post the important parts of it

Thanks in advance


~Snapple
Reply With Quote

  #2 (permalink)  
Old 02-16-2007, 02:36 PM
Registered User
 
Join Date: Jun 2004
Location: Ann Arbor, MI, USA
Posts: 73
Send a message via ICQ to \Kritikal\ Send a message via AIM to \Kritikal\
This ain't pretty, but it could work:

Code:
var formAction = "mailto:eat@joes.com";

var theForm = document.createElement("form");
theForm.setAttribute("id","emailSender");
theForm.setAttribute("action",formAction);
theForm.setAttribute("method","post");

var theTextArea = document.createElement("textarea");
theTextArea.setAttribute("name","quizHTML");
theTextArea.innerHTML = callToFunctionThatWritesHTML();

theForm.appendChild(theTextArea);
document.getElementsByTagName("body")[0].appendChild(theForm);
document.getElementById("emailSender").submit();
The best way to do this is to create an Iframe, append it like I did the form, and then write the form to the Iframe's content. If you simply do what I've pasted the page will redirect. If you use an Iframe, you can just submit the form and then remove the Iframe.
__________________
-\Kritikal\-
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Online Quiz Problem O~Snapple Programming and Scripting 1 12-19-2006 10:00 PM
Need Javascript Help elTGray Programming and Scripting 2 03-15-2006 02:42 PM
Please help. Web code displaying instead of result of code daisywheel Programming and Scripting 3 03-10-2006 07:30 AM
Javascript problem in setting URL gilgalbiblewhee Programming and Scripting 2 03-07-2006 02:34 PM
Trying to combine Slideshow javascript and transparent PNG files moez Programming and Scripting 0 01-23-2006 10:38 AM


All times are GMT -5. The time now is 05:03 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter