Index: lams_tool_notebook/web/pages/learning/notebook.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/learning/notebook.jsp,v
diff -u -r1.30.2.4 -r1.30.2.5
--- lams_tool_notebook/web/pages/learning/notebook.jsp 23 Nov 2016 08:19:51 -0000 1.30.2.4
+++ lams_tool_notebook/web/pages/learning/notebook.jsp 23 Nov 2016 17:28:51 -0000 1.30.2.5
@@ -8,46 +8,31 @@
document.getElementById("finishButton").disabled = true;
}
- function validateForm() {
-
- // Validates that there's input from the user.
-
- // disables the Finish button to avoid double submittion
- disableFinishButton();
-
- if (mode == "learner") {
- // if this is learner mode, then we add this validation see (LDEV-1319)
-
- if (document.learningForm.entryText.value == "") {
-
- // if the input is blank, then we further inquire to make sure it is correct
- if (confirm("message.learner.blank.input")) {
- // if correct, submit form
- return true;
- } else {
- // otherwise, focus on the text area
- document.learningForm.entryText.focus();
- document.getElementById("finishButton").disabled = false;
- return false;
- }
- } else {
- // there was something on the form, so submit the form
- return true;
- }
- }
+ function textAreaReady() {
+ document.learningForm.focusedInput.focus();
+ document.getElementById("finishButton").disabled = false;
}
-
+
function submitForm(methodName) {
+ disableFinishButton();
if (forceResponse =="true" && document.learningForm.focusedInput.value == "") {
if (confirm("message.learner.blank.alertforceResponse")) {
return true;
} else {
// otherwise, focus on the text area
- document.learningForm.entryText.focus();
- document.getElementById("finishButton").disabled = false;
+ textAreaReady();
return false;
}
- }
+
+ } else if (forceResponse =="false" && document.learningForm.focusedInput.value == "" && mode == "learner") {
+
+ if (!confirm("message.learner.blank.input")) {
+ // otherwise, focus on the text area
+ textAreaReady();
+ return false;
+ }
+ }
+
var f = document.getElementById('messageForm');
f.submit();
}
@@ -103,7 +88,7 @@
-
+
@@ -152,6 +137,9 @@
\ No newline at end of file