0

ok so i have this in query:

$(document).ready(function(){
	$("input#copy").click(function(){
		if ($("input#copy").is(':checked'))
		{
			// Checked, copy values
			$("input#owner_address").val($("input#subject_address").val());
			$("input#owner_city").val($("input#subject_city").val());
			$("input#owner_state").val($("input#subject_state"));
			$("input#owner_zip").val($("input#subject_zip").val());
		}
		else
		{
			// Clear on uncheck
			$("input#owner_address").val("");
			$("input#owner_city").val("");
			$("input#owner_state").val("");
			$("input#owner_zip").val("");
		}
	});
});

That works fine for input:text boxes but doesnt work for dropdown menus. How to i have the state dropdown to be the same for the other

thanks in advance.

2
Contributors
8
Replies
9
Views
6 Years
Discussion Span
Last Post by itisnot_me
0

ok so i looked over the doc and i could get your code to work even when i changed the input to select. Its given that i changed the dropdownanme

even with trying the easy way of getting the value of the select

$("select#owner_state").val($("select#subject_state").val());

im pretty new to jquery

0

ok then try this:

$("#owner_state").val($("#subject_state :selected").val());

this will work fine.

0

i apologize for some reason it didnt work at first. but now magically it doesn't.

thanks again

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.