Fixed a validation error where the form wouldn't validate after the deletion of a row within any table

This commit is contained in:
vince0656 2018-06-15 10:09:15 +01:00
parent 6fc6628995
commit 498b87dba5
3 changed files with 28 additions and 8 deletions

View file

@ -832,4 +832,17 @@ $('.formset-form-remove').click(function (e) { // Ported from DEMOS1
}
updateFormset(formset);
formset.trigger('formsetFormRemoved');
// Perform validation now that a row has been removed
switch (formPrefix) {
case 'option':
validateFormField(isPollOptionsValid, "options-input-error-block");
break;
case 'organiser':
validateFormField(areOrganisersEmailsValid, "organisers-input-error-block");
break;
case 'trustee':
validateFormField(areTrusteesEmailsValid, "trustees-input-error-block");
break;
}
});