Click to See Complete Forum and Search --> : html/javascript


cbowden
11-18-2003, 04:36 PM
I'm trying to create a quiz with a bunch of radio buttons. When the user presses the submit button i wanted it to open a window showing the answers the person chose as well as whether or not they got the right answer. So i generated the following code:

function DisplaySumm()
{
SummWin = window.open('','NewWin', 'Toolbar=no,status=no,width=300,heigth=500')

Message = "<center><h3>Quiz Results</h3></center><ul>"
+ "<li><i>Name: </i><b>" +
document.frmSites.realname.value + "</b>" ;
+ "<li><i>Email: </i><b>" + document.frmSites.email.value + "</b>" ;
+ "<li><i>Question 1: </i><b>" + document.frmSites.Q1Q1.value + "</b>" ;
+ "<li><i>Question 2: </i><b>" + document.frmSites.Q1Q2.value + "</b>" ;

SummWin.document.write(Message) ;
}

Along with the onclick function to set to open this function. When i try it it can read the email and name fields but none of the radio button values. it also opens up another window with the initial quiz in it. I can't figure out why. Please help.

gil davis
11-18-2003, 04:48 PM
It is not likely that the problem is in it bit of code you have posted. The most important part of being able to solve a problem is to have the whole picture. It is best to have a link, because people don't seem to get the true situation into their post, even by cutting and pasting. If you cannot post a link, then put everything into a .zip file and attach it (images, external scripts, external style sheets) to your next post.