updatedone event

Hi
Can some point out where i am going wrong. i am getting the alert that the os variable is set, but i am losing it outside the function

$(document).on(“updatedone”, function(e, args) {
if (args.target.id == “x_orderStatus”) {
var os = $(args.target).val();
alert(‘OS SET’+os );
}
});

alert(os);


thanks

Your code retrieve the value before the event is fired, you can only use it after it is set.

thanks,
how do i go about getting the current value of a field within jquery and store it as a variable to use within my scripts