Commit 2efe8f0809fac1c4e68fc45b61e68ffa66c4f4c4
Committed by
Thiago Ribeiro
1 parent
2aee71d5
Exists in
master
and in
3 other branches
Fix verify_error regex on create-institution.js
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
public/views/create-institution.js
| ... | ... | @@ -126,7 +126,11 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
| 126 | 126 | var error_keys = Object.keys(errors); |
| 127 | 127 | |
| 128 | 128 | // (field)|(field)|... |
| 129 | - var verify_error = new RegExp("(" + error_keys.join(")|(") + ")" ); | |
| 129 | + var verify_error = new RegExp("(\\[" + error_keys.join("\\])|(\\[") + "\\])" ); | |
| 130 | + | |
| 131 | + console.log(error_keys); | |
| 132 | + console.log(""); | |
| 133 | + console.log(verify_error); | |
| 130 | 134 | |
| 131 | 135 | var fields_with_errors = $("#institution_dialog .formfield input").filter(function(index, field) { |
| 132 | 136 | return verify_error.test(field.getAttribute("name")); |
| ... | ... | @@ -396,7 +400,7 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
| 396 | 400 | set_form_count_custom_data(); |
| 397 | 401 | set_events(); |
| 398 | 402 | }, |
| 399 | - | |
| 403 | + | |
| 400 | 404 | institution_autocomplete: function(){ |
| 401 | 405 | institution_autocomplete(); |
| 402 | 406 | } | ... | ... |