When using a multi value field with an 'add more' button, all inputted data is lost after using the 'add more' button and input is blocked. This is cause by a Drupal 7 core bug, patch to solve this can be found at #208611-49: Add drupal_array_merge_deep() and drupal_array_merge_deep_array() to stop drupal_add_js() from adding settings twice

Comments

dureaghin’s picture

Not great solution, but works for me:

<script src="/sites/all/libraries/maskedinput/jquery.maskedinput.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function($){

$(document).ready(function(){ 

   $(".date").mask("99/99/9999",{placeholder:"mm/dd/yyyy"});
   $(".phone").mask("(999) 999-9999");
   $(".fein").mask("99-9999999");
   $(".ssn").mask("999-99-9999");

});

// Add More fix
$(document).on('click', '.phone', function (evt) {
        $(".phone").mask("(999) 999-9999");
}); 

});
</script>