Hi. I am trying to do the next thing in Jquery. I have 2 comboboxes and i want to make sure that their selected values is identical. If user chooses a value in one of the combo like the other one, i want to alert "invalid op" and set the combo selected value to its previous value. so i wrote:
$("#SelectGroupMargin").live("onchange", function() {
// save the value before the change in case the change is invalid
var valBeforeChange = $("#SelectGroupMargin").val();
var currentLimitedRuleVal = $("#SelectGroup").val();
var newFillerRule= $(this).val();
// check that the new value does not colide with the value of the limited rule
// if it does colide alert the user and return to the former value
if (currentLimitedRuleVal == newFillerRule) {
alert("invalid op");
$("#SelectGroupMargin").text(valBeforeChange);
}
});
but i have few problems: 1)onchange doesn't respond - just click and focusout 2) newFillerRule always identical to valBeforeChange
Do you have better idea/shorter any advice thank u