Hello,
On my add page I want to "auto-save" the record when a text field losses focus, but only if a checkbox field on the same add page has been selected. I use a field event on the text field, which is set to fire on "change", and in the "client after" section I have this code:
------------------------
var ctrlas = Runner.getControl(pageid,'AutoSave');
if (ctrlas.getValue().ToString() == "1") {
$("#saveButton1").trigger('click');
}
------------------------
But this doesn't seem to work. Can anyone see what I'm doing wrong?
If I just have the auto-save code (i.e. $("#saveButton1").trigger('click'); ) it works, so it seems to be something with the "if" statement.
Thanks,
Tim
On my add page I want to "auto-save" the record when a text field losses focus, but only if a checkbox field on the same add page has been selected. I use a field event on the text field, which is set to fire on "change", and in the "client after" section I have this code:
------------------------
var ctrlas = Runner.getControl(pageid,'AutoSave');
if (ctrlas.getValue().ToString() == "1") {
$("#saveButton1").trigger('click');
}
------------------------
But this doesn't seem to work. Can anyone see what I'm doing wrong?
If I just have the auto-save code (i.e. $("#saveButton1").trigger('click'); ) it works, so it seems to be something with the "if" statement.
Thanks,
Tim