JS File Changes/jQuery Functions/Latest JS files/Demos

The following files are attached which contain all of the necessary JS/jQuery information.


  • Javascript.doc (version 8.6 and below) which describes all JS functions used in version 8.6 and below.
  • Javascript_JQuery.doc (version 8.7 and above) which describes the most up-to-date examples on all of Survox jQuery javascript functions.
  • JSChanges.txt file is a summary of all of the JS/jQuery functions with notes on what has changed between using JS versus jQuery JS.


The following demos show examples on how to use the JS/jQuery functions:


1) Features Demo –http://demos.survoxinc.com/env1a/demos/features/index.php


NOTE: This demo has been tested in recent versions of Chrome, Firefox, Safari and IE browsers. We do not recommend using older browsers as we cannot guarantee that all will work as expected in older browsers or if the incorrect mode is set in IE.


If you’d like the entire Features Demo package which includes the spec, CSS, and template files, please submit a ticket requesting it.


2) Advanced Web Training –http://demos.survoxinc.com/env1a/demos/advanced/AdvancedTraining/TrainingIndex.html


This shows advanced web training examples of html, css, Javascript, JQuery, Mobile Devices, Drag and Drop question types, Slider question types, Click Data, and basic debugging formatting techniques.



Some of the highlighted JS functions and jQuery files demonstrated are:


  • Response List (Single) – SetOtherInterval JS function
  • Response List (Multiple) – SetOtherInterval and SetMultipleResponseCheck JS functions
  • Numeric – setNumericCheck JS function
  • Text Questions – SetTextException and SetTextCheck JS functions
  • Side-by-side Rating Table – ClickCell_jquery.js
  • Side-by-side Embedded Table – ClickCell_jquery.js
  • Rating Scale (Conditional) – ClickCell_jquery.js
  • Running Total – setTotal JS function
  • Sliders (Vertical) – setScaleSlider JS function, ScaleSlider_jquery.js
  • Sliders (Horizontal) – setScaleSlider JS function, ScaleSlider_jquery.js
  • Sliders (Paired Comparison) – setScaleSlider JS function, ScaleSlider_jquery.js
  • Sliders (Midpoint) – setScaleSlider JS function, ScaleSlider_jquery.js
  • Drag and Drop – setDragNDropRank JS function, DragNDropRank_jquery.js
  • Card Sort – SetCardSort JS function, CardSort_jquery.js
  • Text Highlight – HighLightMode_jquery.js
  • Block Scale – setBlockScale JS function, BlockScale_jquery.js
  • Image Click and Display – setClickData JS function, ClickData_jquery.js



jQuery Changes in VERSION 8.7+

  • Automated checks using jQuery have been created so that functions like setunique or setother etc. do not need to be used anymore.
  • The hidden inputs in the page tell the javascript how to do it so you don’t have to.
  • You have the option of turning those checks on or off.
  • The hidden inputs are created by websurvent/webcati and are derived from the survent syntax.


For example:


(-) 99 Don’t Know


in a question would create a hidden input for that question that tells it there is an unique response and what that response is. The same is true for the other automated checks as well so the survent syntax being used is something you will want to look at.


The old functions will still work if they need to be used in Version 8.7+, but all JS/JQuery files should be copied over to the new 8.7 install to be used.


Old index pages and pagetops will need to be updated to use the new JQuery files. Any new index pages and pagetops created should have the paths to the new files already in them.



jQuery Automatic checks


Other Specify:

  • Behaves like the old setother/findother function
  • Unlimited number of other specify responses
  • Automatically checks an other specify response when specify text is entered
  • Global variables
  • Force text entry if other specify response is checked. Default is true.
  • Popup Other specify box entry. Default is false.
  • Hide Other specify box until specify response is checked. Default is false.


Unique Response:

  • Behaves like the old setunique function
  • Unlimited number of unique responses
  • Automatically checks for other specify responses associated with the question
  • Global Variables
  • Controls how an error is presented when a unique response and another response is given.
  • alert: Popup error message. Default setting is alert.
  • confirm: Presents a dialogue box as to which response should be cleared. The unique response or the other responses.
  • none: No error presented. Clears the last response checked.


Number of responses on Multiple Response Questions:

  • Behaves like the old setmultiple function
  • Can only check maximum number of responses and not a minimum number of responses


Numeric Checks:

  • Behaves like the old setnum/setnumeric function
  • Checks for range
  • Checks for number of decimals
  • Disallows checking an exception response and entering a number
  • Global Variables
  • Force a numeric response: Force either a numeric response or an exception code. Default is true.
  • Allow fewer decimals: Allow fewer than the specified number of decimals. Default is false.


Required Checks:

  • Behaves like the old setnoskip function
  • Prompts if a response is not given to a required questions
  • Question set to subtype BLANK_OK or inside a GRID,BLANK_OK have the automatic checks turned off
  • Can use a generic error message or question specific ones
  • Global Variables
  • Controls how an error message is presented when a response is not given.
  • alert: Presents an error message and page cannot be submitted until a responses is given.
  • confirm: Presents a dialogue box. If Ok is clicked page is allowed to submit without response. If cancel is clicked then a response must be given.

Text Length Checks:

  • Behaves like the old textlen function
  • Checks for maximum number of responses on var and text type questions
  • Checks for minimum number of characters on var type questions
  • Option to present the remaining number of characters that can be typed
  • Global Variables
  • Optional warning can be presented when approaching the maximum number of characters. Default is 0 but can be set to any number below the max.



Automatic Checks vs Individual Checks

The above functions can be turned off and individual checks run instead. In most cases this provides individual question control over the globalsettings for these functions.

  • JSChanges.txt
  • javascript_jquery.doc
  • javascript.doc