Parent: [ba2807] (diff)

Download this file

custom-fields.js    24 lines (23 with data), 916 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(function() {
$('form[action=set_custom_fields]').submit(function(evt) {
$(this).find('input[name^=custom_fields-][name$=label]').each(function(){
if(this.value==''){
evt.preventDefault();
flash('Every custom field must have a label', 'error');
}
});
$(this).find('.state-field-container').each(function() {
$(this)
.filter(function() {
return $(this).find(':input:visible[name$=type]').val() == 'milestone';
})
.find(':input[name^=custom_fields-][name*=milestones-][name$=.name]').each(function() {
if(this.value=='') {
evt.preventDefault();
flash('Every milestone must have a name', 'error');
}
});
});
return true;
});
}());