mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-13 01:41:09 +08:00
fixed error message duplication
This commit is contained in:
parent
b44a284b54
commit
b672d85405
2 changed files with 9 additions and 5 deletions
|
|
@ -93,12 +93,16 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('submit', function(ev) {
|
.on('submit', function(ev) {
|
||||||
textValidator(ev, element.find("#experiment-name"), false);
|
form.clearFormErrors();
|
||||||
textValidator(ev, element.find("#experiment-description"), true);
|
});
|
||||||
})
|
|
||||||
.clearFormErrors();
|
$("#new-experiment-modal").on("hidden.bs.modal", function (){
|
||||||
|
form.clearFormErrors();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize no description edit link
|
// Initialize no description edit link
|
||||||
function initEditNoDescription(){
|
function initEditNoDescription(){
|
||||||
var modal = "#edit-experiment-modal-";
|
var modal = "#edit-experiment-modal-";
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class Experiment < ActiveRecord::Base
|
||||||
presence: true,
|
presence: true,
|
||||||
length: { minimum: 4, maximum: 50 },
|
length: { minimum: 4, maximum: 50 },
|
||||||
uniqueness: { scope: :project, case_sensitive: false }
|
uniqueness: { scope: :project, case_sensitive: false }
|
||||||
validates :description, length: { maximum: 255 }
|
validates :description, length: { maximum: 50 }
|
||||||
validates :project, presence: true
|
validates :project, presence: true
|
||||||
validates :created_by, presence: true
|
validates :created_by, presence: true
|
||||||
validates :last_modified_by, presence: true
|
validates :last_modified_by, presence: true
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue