View Single Post
Old 11-12-2012, 06:58 PM   PM User | #3
Riku
New Coder

 
Join Date: Feb 2012
Location: Finland
Posts: 57
Thanks: 3
Thanked 9 Times in 9 Posts
Riku is an unknown quantity at this point
Something like this?

Code:
<script src="http://code.jquery.com/jquery-latest.js"></script>

<select>
<option id="country_and_cost">Select country</option> 
<option value="27">Argentina</option> 
<option value="95">Australia</option> 
<option value="150">Austria</option>
</select>

<input type="text" id="cost" readonly="readonly" value="" />

<script type="text/javascript">
// <![CDATA[
	$(document).ready( function() { 
	var selection = 0;
	$('select').change(function() {
	selection = $(this).val();
	$('#cost').val('Cost = ' + selection);
	});
	})
// ]]>
</script>
Hope this helps.

-Riku

Last edited by Riku; 11-12-2012 at 06:59 PM.. Reason: for got to wrap my code around CODE tags, love <3
Riku is offline   Reply With Quote