summaryrefslogtreecommitdiff
path: root/templates/chimere/edit.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/chimere/edit.html')
-rw-r--r--templates/chimere/edit.html22
1 files changed, 12 insertions, 10 deletions
diff --git a/templates/chimere/edit.html b/templates/chimere/edit.html
index 48f18ef..23df7aa 100644
--- a/templates/chimere/edit.html
+++ b/templates/chimere/edit.html
@@ -181,29 +181,31 @@
{% endif %}
{% endcomment %}
+ $('#modal-edit button.btn-primary').unbind("click");
$('#modal-edit button.btn-primary').click(function(){
// JS tests because if a file is submited there is no way
// to refill the form with (browser security issue)
if (typeof tinyMCE !== 'undefined') tinyMCE.triggerSave();
- validation = [{%if route%}
- 'id_route'{%else%}'id_point'{% endif %},
- 'id_name',
- 'id_categories',{% if event %}
- 'id_start_date',{% endif %}
+ validation = [
+ '{% if geom_name == 'marker' %}point{% else %}{{geom_name}}{% endif %}',
+ 'name',
+ 'categories',{% if event %}
+ 'start_date',{% endif %}
];
var validated = true;
for (var idx=0; idx<validation.length ;idx++){
var input_id = validation[idx];
- var val = jQuery('#'+input_id).val();
+ var selec = '[name=' + input_id + ']';
+ var val = jQuery(selec).val();
if (!val || val == '0' ||
(input_id == 'id_submiter_email' &&
!isValidEmailAddress(val))){
- jQuery('#'+input_id).parent().addClass('warning');
- jQuery('#'+input_id).parent().addClass('error');
+ jQuery(selec).parent().addClass('warning');
+ jQuery(selec).parent().addClass('error');
validated = false;
} else {
- jQuery('#'+input_id).parent().removeClass('warning');
- jQuery('#'+input_id).parent().removeClass('error');
+ jQuery(selec).parent().removeClass('warning');
+ jQuery(selec).parent().removeClass('error');
}
}
if (!validated){