Select Option from another forms radio button

I have two forms on a page.  One form has radio buttons.  All of the values of the radio buttons are equal to the values of Select Options on another form.  If a user clicks on one of the radio buttons on form 1  I want to automatically change the selected on form two to the that value of the radio button.

var sensorpick is from the raio button and $sensors is the ID of the Select on the second form:
<script>
$("#sensor-choose").change(function() {
	var sensorpick = $("input:radio[name='sensor-choose']:checked").val();
	$('#sensor option[value="' + sensorpick+ + '"]').prop('selected', true);
		});


<html>
<form method="GET" id="sensor_finder">	
	
		if you already have a Coherent sensor or meter, please make your selection below.<br />
	<!--  START Find a Sensor  -->	
		<div class="form-control">
			<select name="sensor" id="sensors">
				<option value="">Find a Sensor</option>
				{exp:channel:entries channel="measurement" dynamic="no"}
					{if sensor_or_meter == "Sensor"}
						<option value="{measurement_product_name}">{measurement_product_name}</option>
					{/if}
				{/exp:channel:entries}
			</select>
		</div>

Open in new window

LVL 8
Robert GranlundAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sajayj2009Commented:
You are using id for multiple radios?
Julian HansenCommented:
As sajayj2009 pointed out you are using the id of the radio instead of the name

Secondly, to set the selected option of a drop down you just have to set the value of the select.

Third - a radio button is easy - when you click it it is set - so all you have to do is pick the item that is clicked and use its value;

// Using .click() rather than .change()
$'"input[name="sensor-choose"]').click(function() {
  // $(this).val() is the value of the clicked radio - so we can use that
  // to set the select val - which will choose the correct option
  $('#sensor').val($(this).val());
});

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.