diff --git a/webapp/web/js/menupage/menumanagement_edit.js b/webapp/web/js/menupage/menumanagement_edit.js
index fc7ca7d53..c9c7bc255 100644
--- a/webapp/web/js/menupage/menumanagement_edit.js
+++ b/webapp/web/js/menupage/menumanagement_edit.js
@@ -91,28 +91,32 @@ var menuManagementEdit = {
validateMenuItemForm: function() {
var validationError = "";
- //Check menu name
- if ($("input[type=text][name=menuName]").val() == ""){
+ // Check menu name
+ if ($('input[type=text][name=menuName]').val() == "") {
validationError += "You must supply a name
";
}
- //Check pretty url
- if ($("input[type=text][name=prettyUrl]").val() == ""){
+ // Check pretty url
+ if ($('input[type=text][name=prettyUrl]').val() == "") {
validationError += "You must supply a pretty URL
";
}
-
- if ($("input:radio[name=selectedTemplate]:checked").val() == "custom") {
- if ($("input[name=customTemplate]").val() == "") {
+ if ($('input[type=text][name=prettyUrl]').val().charAt(0) != "/") {
+ validationError += "The pretty URL must begin with a leading forward slash
";
+ }
+
+ // Check custom template
+ if ($('input:radio[name=selectedTemplate]:checked').val() == "custom") {
+ if ($('input[name=customTemplate]').val() == "") {
validationError += "You must supply a template
";
}
}
- //if no class group selected, this is an error
- if ($("#selectClassGroup").val() =='-1'){
+ // if no class group selected, this is an error
+ if ($('#selectClassGroup').val() =='-1') {
validationError += "You must supply a content type
";
} else {
//class group has been selected, make sure there is at least one class selected
var allSelected = $('input[name="allSelected"]:checked').length;
- var noClassesSelected = $("input[name='classInClassGroup']:checked").length;
+ var noClassesSelected = $('input[name="classInClassGroup"]:checked').length;
if (allSelected == 0 && noClassesSelected == 0) {
//at least one class should be selected
validationError += "You must select the type of content to display
";
diff --git a/webapp/web/templates/freemarker/edit/forms/menuManagement.ftl b/webapp/web/templates/freemarker/edit/forms/menuManagement.ftl
index f1e020156..ef7c8c363 100644
--- a/webapp/web/templates/freemarker/edit/forms/menuManagement.ftl
+++ b/webapp/web/templates/freemarker/edit/forms/menuManagement.ftl
@@ -28,7 +28,7 @@
-
(Format: /
Must begin with a leading forward slash: / (e.g., /people)
Template *