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
{{ message }}
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
An old bug has reappeared in v1.4.5. When you exclude fields from saving, it also removes them from the actual form. Your previous fix method of changing getFormData() to use $.extend() doesn't work now, at least in Chrome. The extend is doing a shallow copy so all the fields are by reference. Change the workingObject and theform changes as well. Even adding extend(true,{}, theform); didn't help.
I've rewritten it so it no longer needs cloning at all. Simpler filtering routine. Removes items from the save list without affecting the original form.
/* * Serialize the form data, omit excluded fields marked with data-sayt-exclude attribute. */functiongetFormData(theform,excludeSelectors){// almost all useable clone methods pass by reference// so I went to a filter style fix on the DOM elements.excludeSelectors.push('[data-sayt-exclude]');// Add attribute selector to the list$elements=theform.find(':input[name]');//All fields with names$elements=$elements.not(excludeSelectors.join());//multi selectvarform_data=$elements.serializeArray();returnform_data;}
The text was updated successfully, but these errors were encountered:
An old bug has reappeared in v1.4.5. When you exclude fields from saving, it also removes them from the actual form. Your previous fix method of changing getFormData() to use $.extend() doesn't work now, at least in Chrome. The extend is doing a shallow copy so all the fields are by reference. Change the workingObject and theform changes as well. Even adding extend(true,{}, theform); didn't help.
I've rewritten it so it no longer needs cloning at all. Simpler filtering routine. Removes items from the save list without affecting the original form.
The text was updated successfully, but these errors were encountered: