Lines 30-35
$(document).ready(function() {
Link Here
|
30 |
$("#submit_form").click( function(event) { |
30 |
$("#submit_form").click( function(event) { |
31 |
event.preventDefault(); |
31 |
event.preventDefault(); |
32 |
var at_least_one_exists = 0; |
32 |
var at_least_one_exists = 0; |
|
|
33 |
var are_valid = 1; |
33 |
$("fieldset.mtt").each( function(){ |
34 |
$("fieldset.mtt").each( function(){ |
34 |
var title = $(this).find('input[name="title"]').val(); |
35 |
var title = $(this).find('input[name="title"]').val(); |
35 |
var content = $(this).find('textarea[name="content"]').val(); |
36 |
var content = $(this).find('textarea[name="content"]').val(); |
Lines 41-48
$(document).ready(function() {
Link Here
|
41 |
var msg = _("Please specify title and content for %s"); |
42 |
var msg = _("Please specify title and content for %s"); |
42 |
msg = msg.replace( "%s", mtt ); |
43 |
msg = msg.replace( "%s", mtt ); |
43 |
at_least_one_exists = 1; |
44 |
at_least_one_exists = 1; |
44 |
alert(msg) |
45 |
alert(msg); |
45 |
return false; |
46 |
return are_valid = false; |
46 |
} else if ( title.length > 0 && content.length > 0 ) { |
47 |
} else if ( title.length > 0 && content.length > 0 ) { |
47 |
at_least_one_exists = 1; |
48 |
at_least_one_exists = 1; |
48 |
} |
49 |
} |
Lines 51-56
$(document).ready(function() {
Link Here
|
51 |
alert( _("Please fill at least one template.") ); |
52 |
alert( _("Please fill at least one template.") ); |
52 |
return false; |
53 |
return false; |
53 |
} |
54 |
} |
|
|
55 |
if ( ! are_valid ) { |
56 |
return false; |
57 |
} |
54 |
|
58 |
|
55 |
// Test if code already exists in DB |
59 |
// Test if code already exists in DB |
56 |
var new_lettercode = $("#code").val(); |
60 |
var new_lettercode = $("#code").val(); |
57 |
- |
|
|