I'm assuming there is more to your code than meets the eye, if so this should do the trick:
$('#connection').change(function(){
$('#database').val('main_database');
});
$('#database').change(function(){
$('#table').val('payments');
});
$('#table').change(function(){
$('#fieldcode').val( 'code' );
$('#fieldcolor').val( 'status' );
});
balupton
2010-07-19 03:05:19