I have a field in my form where I am adding some testing to get new and old values.
This is so I can enable the save button when a change is detected.
When I load the data, the change.delegate
keeps firing, even though I have not focused the field or changed the info in it.
I am at a loss.
This is my html:
<input type="text" value.bind="customerRecord[0].customer.ssn1"
focus.delegate="this.origSsn1 = this.value"
change.delegate="hasChanged(this)" name="ssn1" id="ssn1">
and this is my js function:
hasChanged(textBox)
{
console.log( 'oldVal', textBox);
if ( textBox.origSsn1 != textBox.value )
{
console.log( 'new value found');
}
return true;
}
I can’t figure out why it’s firing constantly.
I have also tried:
change.trigger
and
focus.trigger
Thanks