Going crazy here:
I am trying to validate a dynamically created RadNumericInput box. I have wired the OnValueCHanged event as follows:
newControl.ClientEvents.OnValueChanged = "CheckAllocation"
I have a javascript routine as follows (stripped down for example):
function CheckAllocation(sender, eventArgs) {
...(do some checking and if number not good then...)
sender.set_value(eventArgs.get_oldValue());
eventArgs.set_cancel(true);
sender.focus();
return false;
}
I simply want to put the old value back in the box and return focus to the sender. The event fires fine and code seems to run, but the focus goes to wherever I clicked, and when I put the old value back in the box it fires OnValueChanged event again...
Is there something I am missing? This seems like it should be pretty simple...
Many Thanks
Ford
I am trying to validate a dynamically created RadNumericInput box. I have wired the OnValueCHanged event as follows:
newControl.ClientEvents.OnValueChanged = "CheckAllocation"
I have a javascript routine as follows (stripped down for example):
function CheckAllocation(sender, eventArgs) {
...(do some checking and if number not good then...)
sender.set_value(eventArgs.get_oldValue());
eventArgs.set_cancel(true);
sender.focus();
return false;
}
I simply want to put the old value back in the box and return focus to the sender. The event fires fine and code seems to run, but the focus goes to wherever I clicked, and when I put the old value back in the box it fires OnValueChanged event again...
Is there something I am missing? This seems like it should be pretty simple...
Many Thanks
Ford