codedance / jquery.AreYouSure

A light-weight jQuery "dirty forms" Plugin - it monitors html forms and alerts users to unsaved changes if they attempt to close the browser or navigate away from the page. (Are you sure?)
508 stars 145 forks source link

Default option with empty value should still be tracked #52

Closed mcdrummerman closed 1 year ago

mcdrummerman commented 10 years ago

Store the value of a select list if the initially selected option has an empty value.

ASP .Net MVC Html helpers have an override for a dropdown list that will add an initial default option (Such as "Please select a value") When this is added though, its value is empty. Which allows for jquery validation to validate if the list is required)

I believe areYouSure.js should store the original value of the select list even if it is an empty string and warn when there is a change.

Also, ensure that isDirty is not set when an element is tagged to be ignored

codedance commented 10 years ago

Hi Rob, Sorry for the late reply on this pull request.

I agree with the first commit 1ec58 and would be happy to merge this.

It's hard to see the delta on the 2nd commit (45e58) due to the white space changes (indenting?). Maybe your editor has reflowed the code. Is there any chance you could reapply?

mcdrummerman commented 9 years ago

Hi Chris,

Thanks for the feedback. You are right, Visual Studio borked the whitespaces in my commit for 45e58.

I reverted my changes and re-applied the changes made in 45e58 without the crazy whitespace changes.

I re-applied changes in commit 9cc1ebf and ultimately corrected an error with my commit in 7af90c6.

sebgmc commented 9 years ago

Hi, has this been pulled into the current version?

mcdrummerman commented 9 years ago

I don't believe so

-Rob On Jun 1, 2015 3:44 AM, "Sebastiaan van Dijk" notifications@github.com wrote:

Hi, has this been pulled into the current version?

— Reply to this email directly or view it on GitHub https://github.com/codedance/jquery.AreYouSure/pull/52#issuecomment-107382924 .