Lines 26-31
$(document).ready(function() {
Link Here
|
26 |
[% END %] |
26 |
[% END %] |
27 |
|
27 |
|
28 |
$("#submit").click( function(event) { |
28 |
$("#submit").click( function(event) { |
|
|
29 |
var at_least_one_exists = 0; |
29 |
$("fieldset.mtt").each( function(){ |
30 |
$("fieldset.mtt").each( function(){ |
30 |
var title = $(this).find('input[name="title"]').val(); |
31 |
var title = $(this).find('input[name="title"]').val(); |
31 |
var content = $(this).find('textarea[name="content"]').val(); |
32 |
var content = $(this).find('textarea[name="content"]').val(); |
Lines 36-45
$(document).ready(function() {
Link Here
|
36 |
var mtt = $(this).find('input[name="message_transport_type"]').val(); |
37 |
var mtt = $(this).find('input[name="message_transport_type"]').val(); |
37 |
var msg = _("Please specify title and content for %s"); |
38 |
var msg = _("Please specify title and content for %s"); |
38 |
msg = msg.replace( "%s", mtt ); |
39 |
msg = msg.replace( "%s", mtt ); |
|
|
40 |
at_least_one_exists = 1; |
39 |
alert(msg) |
41 |
alert(msg) |
40 |
event.preventDefault(); |
42 |
event.preventDefault(); |
|
|
43 |
return false; |
44 |
} else if ( title.length > 0 && content.length > 0 ) { |
45 |
at_least_one_exists = 1; |
41 |
} |
46 |
} |
42 |
} ); |
47 |
} ); |
|
|
48 |
if ( ! at_least_one_exists ) { |
49 |
alert( _("Please fill at least one template.") ); |
50 |
event.preventDefault(); |
51 |
return false; |
52 |
} |
43 |
return true; |
53 |
return true; |
44 |
}); |
54 |
}); |
45 |
|
55 |
|
Lines 212-218
$(document).ready(function() {
Link Here
|
212 |
|
222 |
|
213 |
[% IF ( add_form ) %] |
223 |
[% IF ( add_form ) %] |
214 |
<h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1> |
224 |
<h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1> |
215 |
<form name="Aform" method="post" enctype="multipart/form-data"> |
225 |
<form name="Aform" method="post" enctype="multipart/form-data" class="validate"> |
216 |
<input type="hidden" name="op" id="op" value="add_validate" /> |
226 |
<input type="hidden" name="op" id="op" value="add_validate" /> |
217 |
<input type="hidden" name="checked" value="0" /> |
227 |
<input type="hidden" name="checked" value="0" /> |
218 |
[% IF ( modify ) %] |
228 |
[% IF ( modify ) %] |
Lines 280-293
$(document).ready(function() {
Link Here
|
280 |
[% ELSE %] |
290 |
[% ELSE %] |
281 |
<option value="suggestions">Suggestions</option> |
291 |
<option value="suggestions">Suggestions</option> |
282 |
[% END %] |
292 |
[% END %] |
283 |
</select> |
293 |
</select> |
284 |
</li> |
294 |
</li> |
285 |
<li> |
295 |
<li> |
286 |
<span class="label">Code:</span>[% IF ( adding ) %]<input type="text" id="code" name="code" size="20" maxlength="20" />[% ELSE %]<input type="hidden" id="code" name="code" value="[% code %]" />[% code %][% END %] |
296 |
[% IF adding %] |
287 |
</li> |
297 |
<label for"code" class="required">Code:</label> |
288 |
<li> |
298 |
<input type="text" id="code" name="code" size="20" maxlength="20" required="required" /> |
289 |
<label for="name">Name:</label><input type="text" id="name" name="name" size="60" value="[% letter_name %]" /> |
299 |
<span class="required">Required</span> |
290 |
</li> |
300 |
[% ELSE %] |
|
|
301 |
<label for="code">Code:</label> |
302 |
<input type="hidden" id="code" name="code" value="[% code %]" />[% code %] |
303 |
[% END %] |
304 |
</li> |
305 |
<li> |
306 |
<label for="name" class="required">Name:</label> |
307 |
<input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" /> |
308 |
<span class="required">Required</span> |
309 |
</li> |
291 |
|
310 |
|
292 |
[% FOREACH letter IN letters %] |
311 |
[% FOREACH letter IN letters %] |
293 |
<li> |
312 |
<li> |
294 |
- |
|
|