Skip to content

Commit

Permalink
Merge pull request reinhardfuehricht#13 from jmverges/master
Browse files Browse the repository at this point in the history
[BUGFIX] Clean up shortName to support array/checkboxes in context of validation
  • Loading branch information
reinhardfuehricht authored Jun 30, 2016
2 parents 5417d4e + 5dd85ba commit 8627392
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Resources/Public/JavaScript/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
var name = field.attr("name");
var shortName = name.replace(settings.formValuesPrefix, '').replace("[", "").replace("]", "");

var regex = /(.*?)\[.*/gi; //Removes deep array keys for checkbox like foo[1]
var clean = regex.exec(shortName);
if(clean.length>0){
shortName = clean[1]
}

var loading = formhandlerDiv.find('#loading_' + shortName);
var result = formhandlerDiv.find('#result_' + shortName);
loading.show();
Expand Down

0 comments on commit 8627392

Please sign in to comment.