Closed p10tyr closed 9 years ago
Just realised this moonrise, using closest always evaluates to true, well in my case: because it right at the start of the DOM.
So instead I added to ignore hidden fields, since I am not bothered about that. I sometimes update hidden fields (in other projects) to submit data even if no form is there.
In this issue, I start the script on all pages because there is allot of data input. So I really don't want to validate hidden helpers.
var getValue = function ($field) {
if ($field.hasClass('ays-ignore')
|| $field.hasClass('aysIgnore')
|| $field.attr('data-ays-ignore')
|| $field.is(':hidden') <------------------
|| $field.attr('name') === undefined) {
return null;
}
Another way to do this without modifying are-you-sure's code would be to use a jquery expression to add the ays-ignore class before loading Are-you-sure . e.g.
$('form').find(':hidden').addClass('ays-ignore');
$('form').areYouSure();
I know who uses this crap still... apprantly big public companies.
Problem spotted when I want to vcalidata all pages and a simple page with postback selector caused issues because of Telerik radcontorllor hidden input chaning and failing the brute force checker.
My Fix
Just ignore all asp hidden values and viewstates and all that or possible allow to pass in extra classes in the options to ignore on.
The moment where you test the field, and this hidden one tests true even though the user did not touch this. Maybe Hiddens should be completely ignore??