Index: lams_central/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -r5949a49ec6308dfce3ac7c88808da019f8260c76 -r1e612192adc45476d007a3254ee9d1903158c064
--- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 5949a49ec6308dfce3ac7c88808da019f8260c76)
+++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 1e612192adc45476d007a3254ee9d1903158c064)
@@ -802,7 +802,6 @@
authoring.template.successful=Your design has been saved as {0}.
authoring.label.sequence.title=Title of Sequence
-authoring.error.sequence.title=Title of Sequence may not be blank
authoring.error.question.num=Question {0} may not be blank
authoring.error.question.correct.num=One of the answers for Question {0} needs to be correct.
authoring.description.application.exercise=Application Exercise (These question(s) will be shown during the analysis phase in the sequence.)
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/TBLTemplateAction.java
===================================================================
diff -u -r5949a49ec6308dfce3ac7c88808da019f8260c76 -r1e612192adc45476d007a3254ee9d1903158c064
--- lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/TBLTemplateAction.java (.../TBLTemplateAction.java) (revision 5949a49ec6308dfce3ac7c88808da019f8260c76)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/TBLTemplateAction.java (.../TBLTemplateAction.java) (revision 1e612192adc45476d007a3254ee9d1903158c064)
@@ -48,6 +48,7 @@
import org.lamsfoundation.lams.rest.RestTags;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.util.AuthoringJsonTags;
+import org.lamsfoundation.lams.util.ValidationUtil;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
@@ -415,9 +416,9 @@
if (contentFolderID == null) {
addValidationErrorMessage("authoring.error.content.id", null);
}
- if (sequenceTitle == null) {
- addValidationErrorMessage("authoring.error.sequence.title", null);
- }
+ if (sequenceTitle == null || ! ValidationUtil.isOrgNameValid(sequenceTitle) ) {
+ addValidationErrorMessage("authoring.fla.title.validation.error", null);
+ }
if (applicationExercises.size() == 0) {
addValidationErrorMessage("authoring.error.application.exercise.num", new Integer[] { 1 });
} else {
Index: lams_central/web/authoring/template/comms.jsp
===================================================================
diff -u -r57b1e805f157838e751282dee740badfb2365271 -r1e612192adc45476d007a3254ee9d1903158c064
--- lams_central/web/authoring/template/comms.jsp (.../comms.jsp) (revision 57b1e805f157838e751282dee740badfb2365271)
+++ lams_central/web/authoring/template/comms.jsp (.../comms.jsp) (revision 1e612192adc45476d007a3254ee9d1903158c064)
@@ -369,3 +369,12 @@
function testURL(urlField) {
launchPopup($('#'+urlField).val(),'popupUrl');
}
+
+ function validateNoSpecialCharacters(inputText) {
+ if ( inputText ) {
+ var validator = /^[^<>^*@%$]*$/igm;
+ var result = validator.test(inputText);
+ return result;
+ }
+ return true;
+ }
Index: lams_central/web/authoring/template/tbl/tbl.jsp
===================================================================
diff -u -r5949a49ec6308dfce3ac7c88808da019f8260c76 -r1e612192adc45476d007a3254ee9d1903158c064
--- lams_central/web/authoring/template/tbl/tbl.jsp (.../tbl.jsp) (revision 5949a49ec6308dfce3ac7c88808da019f8260c76)
+++ lams_central/web/authoring/template/tbl/tbl.jsp (.../tbl.jsp) (revision 1e612192adc45476d007a3254ee9d1903158c064)
@@ -29,7 +29,10 @@
// validate signup form on keyup and submit
var validator = $("#templateForm").validate({
rules: {
- sequenceTitle: "required",
+ sequenceTitle: {
+ required: true,
+ validateNoSpecialCharacters: true
+ },
question1correct: "required",
question1: {
required: validateCK
@@ -40,7 +43,10 @@
<%@ include file="../groupingvalidation.jsp" %>
},
messages: {
- sequenceTitle: '',
+ sequenceTitle: {
+ required: '',
+ validateNoSpecialCharacters: ''
+ },
question1: '',
question1correct: '',
assessment1: '',
@@ -55,6 +61,8 @@
},
});
+ jQuery.validator.addMethod("validateNoSpecialCharacters", validateNoSpecialCharacters, '');
+
// Remove the display:none or the fields won't be validate as jquery validation is set to only valid non hidden fields.
// If we allow validation of hidden fields then we cannot have validation on the Still should not be seen as visibility is hidden
// catch the editor update and redo validation otherwise error message won't go away when the user enters text.