Lines 34-58
function active(numlayer)
Link Here
|
34 |
} |
34 |
} |
35 |
} |
35 |
} |
36 |
function Check(f) { |
36 |
function Check(f) { |
37 |
|
|
|
38 |
var total_errors=0; |
37 |
var total_errors=0; |
39 |
// alert(f.field_value.length); |
38 |
$("input[name='mandatory'],select[name='mandatory']").each(function(i){ |
40 |
for (i=0 ; i<f.field_value.length ; i++) { |
39 |
if($(this).val() == 1){ |
41 |
// alert (f.field_value[i].value); |
40 |
var mandatory_field = $("input[name='field_value'],select[name='field_value']").eq(i); |
42 |
if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) { |
41 |
if(mandatory_field.val() == ''){ |
43 |
document.getElementById("error"+i).style.backgroundColor="#FF0000"; |
42 |
mandatory_field.css("background-color","#FFFFCC"); |
44 |
total_errors++; |
43 |
total_errors++; |
45 |
} else { |
44 |
} |
46 |
// document.getElementById("error"+i).style.backgroundColor="#FFFFFF"; |
|
|
47 |
} |
45 |
} |
48 |
} |
46 |
}); |
|
|
47 |
|
49 |
var alertString2; |
48 |
var alertString2; |
50 |
if (total_errors==0) { |
49 |
if (total_errors==0) { |
51 |
return true; |
50 |
return true; |
52 |
} else { |
51 |
} else { |
53 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
52 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
54 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
53 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
55 |
alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)"); |
54 |
alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (highlighted)"); |
56 |
alert(alertString2); |
55 |
alert(alertString2); |
57 |
return false; |
56 |
return false; |
58 |
} |
57 |
} |
Lines 237-244
function set_to_today(id, force) {
Link Here
|
237 |
<ol> |
236 |
<ol> |
238 |
[% FOREACH ite IN item %] |
237 |
[% FOREACH ite IN item %] |
239 |
<li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]"> |
238 |
<li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]"> |
240 |
|
239 |
[% IF ( ite.mandatory ) %] |
241 |
<label>[% ite.subfield %] - [% IF ( ite.mandatory ) %]<b>[% END %][% ite.marc_lib %][% IF ( ite.mandatory ) %] *</b>[% END %]</label> |
240 |
<label class="required">[% ite.subfield %] - [% ite.marc_lib %]</label> |
|
|
241 |
[% ELSE %] |
242 |
<label>[% ite.subfield %] - [% ite.marc_lib %]</label> |
243 |
[% END %] |
242 |
[% ite.marc_value %] |
244 |
[% ite.marc_value %] |
243 |
<input type="hidden" name="tag" value="[% ite.tag %]" /> |
245 |
<input type="hidden" name="tag" value="[% ite.tag %]" /> |
244 |
<input type="hidden" name="subfield" value="[% ite.subfield %]" /> |
246 |
<input type="hidden" name="subfield" value="[% ite.subfield %]" /> |
Lines 246-252
function set_to_today(id, force) {
Link Here
|
246 |
[% IF ( ite.repeatable ) %] |
248 |
[% IF ( ite.repeatable ) %] |
247 |
<span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span> |
249 |
<span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span> |
248 |
[% END %] |
250 |
[% END %] |
249 |
|
251 |
[% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %] |
250 |
</div></li> |
252 |
</div></li> |
251 |
[% END %] |
253 |
[% END %] |
252 |
</ol> |
254 |
</ol> |
253 |
- |
|
|