How about:
(Updated)
$("#column_select").change(function () {
$("#layout_select")
.find("option")
.show()
.not("option[value*='" + this.value + "']").hide();
$("#layout_select").val(
$("#layout_select").find("option:visible:first").val());
}).change();
(assuming the third option
should have a value col3
)
Example: http://jsfiddle.net/cL2tt/
Notes:
.change()
event to define an event handler that executes when the value of select#column_select
changes..show()
all option
s in the second select
..hide()
all option
s in the second select
whose value
does not contain the value
of the selected option in select#column_select
, using the attribute contains selector.