Javascript - Open new URL and transfer data based on two form values

I'm completely new to javascript, but I'm trying to create a beta form for a focus group test. The end product will be professionally developed, but I need a short term, functioning solution. It only has to function one time on one computer, so I can use any method (cookies, webstorage, etc.) to transfer data between pages.

I have a form with a ddl with 10 options. For example:

<select name="sector" id="sectorchoice"><option value="religion">Religion</option><option value="health">Health</option></select>

I also have a radio button that will open one of two URLs depending on whether or not it is checked (onclick="greport"() through submit button).

function greport() {
    if (document.getElementById('radio1').checked = true) { ("","mywindow");

    if (document.getElementById('radio1').checked = false) { ("","mywindow");

I need to load one of nine images on and based on the "sectorchoice" value in the first dropdown. How can I transfer the value and create a function to open the correct image? Thanks.


= and == are two different things.

= the assignment operator

var box = "A Big Box";

== is the comparison operator, and the statement returns a boolean

a == b 

so you will make this change in your code

document.getElementById('radio1').checked == true

Need Your Help

Load a .rtf File into a RichTextBox and Maintain/Persist the Formatting

c# winforms richtextbox richtext

All, I write a log file to a .rtf file which has formatting underlining, bold etc. I have saved this file and want to read it back into the RichTextBox at a later time persisting its formatting. I ...

SQL Query based on occurrence of records

sql-server sql-server-2005

After a long time, I am getting a chance to post a SQL Server question here.