Forum Moderators: phranque

Message Too Old, No Replies

JavaScript Problem Help!

         

jennashton

9:08 pm on Apr 3, 2003 (gmt 0)

10+ Year Member



I am working on a simple quiz for my site. Instead of having the answer.html poping up another window to display the results. I would like to have the result page which is answer.html displayed on the same page. How do I do that? Do I just replace var win = window.open(url, 'Product'); to window.location=url;? Please help!

<script>
function wizard()
{

url = '';

if (document.finder.radio0[0].checked) {
url = url + '1';
} else {
url = url + '2';
}

if (document.finder.radio1[0].checked) {
url = url + '1';
} else {
url = url + '2';
}

if (document.finder.radio2[0].checked) {
url = url + '1';
} else if (document.finder.radio2[1].checked) {
url = url + '2';
} else {
url = url + '3';
}

if (document.finder.radio3[0].checked) {
url = url + '1';
} else {
url = url + '2';

}

url = 'answer.html?' + url + '00';

var win = window.open(url, 'Product');
win.focus();
return true;
}

</script>

sepang

12:35 am on Apr 6, 2003 (gmt 0)

10+ Year Member



yo

Either I didn't totally understood what you want to do, either I find your snippet pretty complicated. (first of all you should your the 'with' method for cleaner code)

Nevermind. To answer your question, you just have to use window.location to redirect a user to a specified page.

in your case


url = 'answer.html?' + url + '00';
self.window.location = url;
return true;

Sepang