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?)
507 stars 145 forks source link

Better performance getValue for select #139

Open hasangursoy opened 6 years ago

myahlGDCI commented 6 years ago

It looks like that case is needed for compatibility with multi-selects. I agree it needs to be optimized though. Perhaps this instead? Note - untested, just off the top of my head.

$field.find('option:selected').each(function() {
    val += $(this).val();
});
hasangursoy commented 6 years ago

val = $field.val(); will be enough for multiselects

myahlGDCI commented 6 years ago

Alright, thanks. :)