If I want to type “Test” into the field I get an alert on pressing “T”, and then another alert on pressing “e”, and then again on pressing “s” and yet again on pressing “t”.
I need to only trigger the event once the user has finished typing into the field or deselected the field. I trying to run a function that updates an item in another list with the changes made to the field and the above is causing this function to fail and also really slowing down the form…
This was not an issue in Forms Designer as the on change triggered once the field was deselected.
Dear Tony,
I see! Yes, in fact the behavior of the event has changed since Forms Designer to allow for more flexibility, but it does seem lacking in cases such as this. We’re going to look into it.
Meanwhile, you can try the following JS:
var test;
$(fd.field('Title').$el).find('input')[0].onfocus = function() {
test = fd.field('Title').value;
console.log(test);
};
$(fd.field('Title').$el).find('input')[0].onblur = function() {
if (fd.field('Title').value != test) {
alert("Changed from: " + test + "\nto: " + fd.field('Title').value);
}
};
Any way to apply the same thing to a people picker field. I have a function firing on change and it seems to be behaving in the same way, do I use the same code as shown above?
Dear @abolam,
People Picker should work the same way, so the code above will help. Accessing value is different for People Picker though, so you might need to change from that: fd.field('Title').value
to: fd.field('Person').value.DisplayText