You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a form with user and password fields on it. These are classed to be ignored so that browser auto filling them does not get in the way. The fields are hidden. The JS that shows the fields removes the dirty ignore class. I also have a "submit" button with CSS so that the button highlights if the form has the dirty class assigned.
If I do not toggle the user/password fields to be visible all works properly.
If I do toggle the fields visible and make a change to the form, the button highlights indicating the form is dirty but no dialog pops up if I attempt to leave the form. This happens with any element, not just the user/password.
Any helpful hints on this would be appreciated.
The text was updated successfully, but these errors were encountered:
I am not sure exactly what is happening here, but I can tell you that when the focus or keydown event of an element is fired and there is no original value stored (i.e. the element was added to the DOM dynamically), Dirty Forms will not respect the ignoreClass in this case. So under this scenario, if the value of the field is not the same as the value that is submitted, the dirty status will be true.
It sounds like there is a lot going on in your form. So it would be best if you could provide an HTML document that reproduces the problem, if possible.
Thanks for the info. The elements are indeed being added to the DOM, but the issue is that the Confirm leaving the page dialog does not pop up. So far as I can tell, the form has the dirty class set. I will try to isolate things and see what I can surmise.
I have a form with user and password fields on it. These are classed to be ignored so that browser auto filling them does not get in the way. The fields are hidden. The JS that shows the fields removes the dirty ignore class. I also have a "submit" button with CSS so that the button highlights if the form has the dirty class assigned.
If I do not toggle the user/password fields to be visible all works properly.
If I do toggle the fields visible and make a change to the form, the button highlights indicating the form is dirty but no dialog pops up if I attempt to leave the form. This happens with any element, not just the user/password.
Any helpful hints on this would be appreciated.
The text was updated successfully, but these errors were encountered: