bulubuk1976
06-11-2003, 01:07 AM
I need you help. I am trying to create an online quiz. I have 2 files, the Quiz.htm and Quiz.js. The questions are in the Quiz.htm and when you click on the evaluate button, it generates a Result page (all text) through quiz.js. The problem is, there are only 2 buttons available on that new page, the PRINT and the CLOSE. I would like to add another button to submit the results to a certain email address. I already have cgi and formmail capability. the problem is that how will I add a button to send all the result information to a particular email address?
Here is the script for the 2 buttons:
winr.document.write("<input type='button' value='Print...' onClick='"+printest+"'> ")
winr.document.write("<input type='button' value='Close' onClick='window.close()'></form></center>")
I would like to add another button to submit all results pointing to my cgi url. please help.
A1ien51
06-11-2003, 02:00 AM
onclick="document.formname.subit();" and have the submit code for the cgi in the form tag
bulubuk1976
06-11-2003, 02:20 AM
Thank you. How do i exactly code it? here is the url for my cgi:
"http://dbscreations.netfirms.com/cgi/formmail".
I am not sure how to code it properly, maybe you can help me with this.
Thanks
JustAsking
06-11-2003, 02:32 AM
Something like the following I suppose.
winr.document.write("<form name='formname' method='post' action='http://dbscreations.netfirms.com/cgi/formmail'>")
winr.document.write("<input type='button' value='Print...' onClick='"+printest+"'> ")
winr.document.write("<input type='button' value='Submit' onClick='document.formname.submit();'>")
winr.document.write("<input type='button' value='Close' onClick='window.close()'></form></center>")
bulubuk1976
06-11-2003, 02:45 AM
Thank you very much! We are getting close. How will I code it so it will send an email to dbs576@aol.com with a subject: Assessment Test.
In HTML I can just declare the recipient and the subject but I don't know how to do it in javascript. Kindly include the recipient and the subject in the coding.
I am very sorry to bother you, I hope you can lead me through making this work.
If it's okay with you, I can settle for a Instant Message conversations.
I really appreciate what you are doing.
Thanks!
JustAsking
06-11-2003, 03:21 AM
It depends on your cgi-script and what it requires to send an email. I would try the following and see if you get an email.
winr.document.write("<center><form name='formname' method='post' action='http://dbscreations.netfirms.com/cgi/formmail'>")
winr.document.write("<input type='button' value='Print...' onClick='"+printest+"'> ")
winr.document.write("<input type='button' value='Submit' onClick='document.formname.submit();'>")
winr.document.write("<input type='button' value='Close' onClick='window.close()'>")
winr.document.write("<input type='hidden' name='subject' value='Email Subject Here'>")
winr.document.write("<input type='hidden' name='recipient' value='dbs576@aol.com'>")
winr.document.write("<input type='hidden' name='redirect' value='http://www.yoursite.com'></form></center>")
bulubuk1976
06-11-2003, 05:11 AM
Sorry it did not send me an email. It is maybe that I need a separate cgi file to process and send the data. What I am using right now is I am suing netfirms formmail handler which I think is the cause of the problem.
Do you know a cgi I can use to make this happen? Or if you can make me one. I know it's too much to ask, but I really am greatful for your suppport.
More power to you.
Dennis
JustAsking
06-11-2003, 07:32 AM
Dennis,
Have a look at these two files I found on google. One is the html file with the hidden field syou need to use and the other is a perl script file used to perform the email sending. Note that to use the perl file this will need to be on a box that reconises .pl files. If you can use the perl file, read the notes and add the neccessary elements so that you can receive email.
Anyhow, have a look and see what you can sort out.
Cheers....Matthew
bulubuk1976
06-11-2003, 07:47 AM
Thanks! I'll keep you posted.
bulubuk1976
06-12-2003, 02:57 AM
Sorry, it did not work. Would you like me to send you the files so you can check them out?
Thanks!