changeset 2730:a13adc8f8d3d

#201 Fixed
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Wed, 19 Apr 2017 09:30:06 +0100
parents 07fcccd5e1a6
children 952e4b75d4de d999a8fc26ea 4bf2f7627cdb
files js/core.js
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/js/core.js	Tue Apr 18 15:35:11 2017 +0200
+++ b/js/core.js	Wed Apr 19 09:30:06 2017 +0100
@@ -873,7 +873,7 @@
 
     function processNumber(node) {
         var input = this.popupContent.getElementsByTagName('input')[0];
-        if (node.mandatory === true && input.value.length === 0) {
+        if (node.specification.mandatory === true && input.value.length === 0) {
             interfaceContext.lightbox.post("Error", 'This question is mandatory. Please enter a number');
             return false;
         }
@@ -882,12 +882,12 @@
             interfaceContext.lightbox.post("Error", 'Please enter a valid number');
             return false;
         }
-        if (enteredNumber < node.min && node.min !== null) {
-            interfaceContext.lightbox.post("Error", 'Number is below the minimum value of ' + node.min);
+        if (enteredNumber < node.specification.min && node.specification.min !== null) {
+            interfaceContext.lightbox.post("Error", 'Number is below the minimum value of ' + node.specification.min);
             return false;
         }
-        if (enteredNumber > node.max && node.max !== null) {
-            interfaceContext.lightbox.post("Error", 'Number is above the maximum value of ' + node.max);
+        if (enteredNumber > node.specification.max && node.specification.max !== null) {
+            interfaceContext.lightbox.post("Error", 'Number is above the maximum value of ' + node.specification.max);
             return false;
         }
         node.response = input.value;