HTML ENHANCEMENTS

Although Survox Survent specifications will run on web surveys without adding any HTML code, adding HTML enhancements produces a much more interesting and aesthetically pleasing questionnaire that might just entice respondents to take part in it. One thing you will want to do is combine questions on one screen using grids. Another is to set up a standard “look and feel” for all questions. Typically, a phone interview requires less HTML page formatting than an online self-administered questionnaire. Some pages in a phone interview, such as an initial call disposition screen, may be more elaborate.

Standardized HTML Code

The following commands will automatically add HTML code to specified places in questions and response lists for uniform formatting; the commands are either HTML_<keyword>_PREFIX or HTML_<keyword>_SUFFIX commands.

{!HTML_DATAQUESTIONS_ONLY }

Only apply !HTML statements to data asking questions.

Default Error Formatting

{!HTML_ERROR_PREFIX/SUFFIX= }

Shortform:  {!HTML_ERR_PRE/SUF= }

Adds the defined HTML code to the beginning and end of error messages generated by web surveys; in this way you can make the error messages a different size and color, or format them to fit nicely inside HTML tables.

Default Page Error Formatting

{!HTML_GRIDERROR_PREFIX/SUFFIX= }

Shortform:  {!HTML_GRIDERR_PRE/SUF= }

This is similar to the above code, but it affects the error messages that appear at the top of the grid. If there is an error on a grid question, an error message is displayed at the top of the page as well as on the specific question within the grid.

NOTE: This can only be set outside of a grid. This is because this command affects the entire page and not just a part of the page, therefore it cannot be changed while inside a grid.

Question Text Formatting

{!HTML_QUESTION_TEXT_PREFIX/SUFFIX= }

Shortform:  {!HTML_TEXT_PRE/SUF= }

Adds defined HTML code before and after the text of the question.

{!HTML_RESPONSE_CODE_PREFIX/SUFFIX= }

Shortform: {!HTML_RC_PRE/SUF= }

Adds defined HTML code before and after the response code if you are displaying response codes on the list.

{!HTML_RESPONSE_TEXT_PREFIX/SUFFIX= }

Shortform:  {!HTML_RT_PRE/SUF= }

Adds defined HTML code before and after the response text of all items on the response list. That is, after the response code but before the response text, or directly after the response text of all items on the list.

Response Item Formatting

{!HTML_RESPONSE_LIST_ITEM_PREFIX/SUFFIX= }

Shortform: {!HTML_RL_PRE/SUF= }

Adds defined HTML code before and after a particular response list item, that is, before the response code, and after the response text for all items.

Response Comment Formatting

{!HTML_RESPONSE_LIST_COMMENT_PREFIX/SUFFIX= }

Shortform:  {!HTML_RLC_PRE/SUF= }

Adds defined HTML code before and after comment-type response list items (==code type items). These are items that have text but do not have a checkbox or radio button.

Response List Formatting

{!HTML_RESPONSE_TABLE_PREFIX/SUFFIX= }

Shortform:  {!HTML_RT_PRE/SUF= }

Adds defined HTML code before and after a response list.

Numeric Input/Exception Formatting

{!HTML_NUM_INPUT_PREFIX/SUFFIX= }

Adds defined HTML code before and after a numeric entry box. This is used for numeric type questions only.

{!HTML_NUM_EXCEPTION_TEXT= }

Shortform: {!HTML_NUM _TEXT= }

Adds text or defined HTML code between a numeric entry box and any exception codes. This is used for numeric type questions only.

Variable Input Formatting

{!HTML_VAR_INPUT_PREFIX/SUFFIX= }

Adds defined HTML code before and after a short-ended entry box.  This is used for variable type questions only.

Text Input Formatting

{!HTML_TEXTQUESTION_INPUT_PREFIX/SUFFIX= }

Adds defined HTML code before and after an open-ended entry box.  This is used for text type questions only.

Formatting Features

There are multiple !HTML commands that you can use to give your surveys a certain look. These blocks of commands can be used in conjunction with the SYSTEM,EXECUTE_COMPILER_DIRECTIVE_BLOCK command that is used when you want to have the same look and feel from screen to screen on your web surveys.

You can define a block of these HTML commands and call them anywhere in your spec where you want to use them. And you can program as many of these blocks as you need.

To define a block begin with a label for the block and the command !START_CD_BLOCK.

Place all !HTML commands to be used in this block. It is recommended that you define all of the !HTML commands for a particular block to insure that all commands are set exactly as you intend them to be.

End this block of commands with !END_CD_BLOCK.

Example:

''Only apply !html statements to data asking questions
{!html_dataquestions_only}

''Default formatting for page errors
{!html_griderror_prefix=<div class="error"> }
{!html_griderror_suffix=</div> }

''Default look - formats all basic FIELD, VARIABLE, NUMERIC and TEXT questions
{ DEFAULT: !START_CD_BLOCK }

''Default Error Formatting
{!html_error_prefix=<span class="error"> }
{!html_error_suffix=</span><br/><br/> }

''Question Text Formatting
{!html_text_prefix=<div class="qtext"> }
{!html_text_suffix=</div><br/> }
{!html_response_code_prefix= }
{!html_response_code_suffix= }
{!html_response_text_prefix= }
{!html_response_text_suffix= }

''Response Item Formatting
{!html_response_list_prefix=<span class="qlabel"> }
{!html_response_list_suffix=</span><br/> }

''Response Comment Formatting
{!html_response_list_comment_prefix=<span class="qcomment"> }
{!html_response_list_comment_suffix=</span><br/> }

''Response List Formatting
{!html_response_table_prefix= }
{!html_response_table_suffix=<br/> }

''Numeric Input Formatting
{!html_num_input_prefix=<span class="qnum"> }
{!html_num_input_suffix=</span> }

''Numeric Exception Formatting
{!html_num_exception_prefix=<span class="qnumexp"> }
{!html_num_exception_suffix=</span> }

''Variable Input Formatting
{!html_var_input_prefix=<span class="qvar"> }
{!html_var_input_suffix=</span><br/> }

''Text Input Formatting
{!html_textquestion_input_prefix=<span class="qtex"> }
{!html_textquestion_input_suffix=</span><br/> }

{!END_CD_BLOCK }

The above block of code can be used for all FIELD, NUMERIC, VARIABLE, and TEXT type questions.  When you want to use this block of code in your spec, simply place a SYSTEM,Execute_Compiler_Directive_Block command that references the name of the block.

Example:

{!SYSTEM,EXECUTE_COMPILER_DIRECTIVE_BLOCK,DEFAULT }

This block of code will apply until another SYSTEM,Execute_Compiler_Directive_Block command is called. You can change individual commands at any time. Keep in mind that once changes are made to individual commands they will apply until another block is called or the individual command is changed again.

NOTE: We recommend that you call in a block of code called CLEAR that clears out all of the HTML commands from the previous block before calling in a new block of code.  HTML commands cascade down the page and clearing out any previous formatting is recommended to ensure that all HTML is cleared.

Example:

{ CLEAR: !START_CD_BLOCK }
{!html_error_prefix=<span class="error"> }
{!html_error_suffix=</span><br/><br/> }
{!html_text_prefix= }
{!html_text_suffix= }
{!html_response_code_prefix= }
{!html_response_code_suffix= }
{!html_response_text_prefix= }
{!html_response_text_suffix= }
{!html_response_list_prefix= }
{!html_response_list_suffix= }
{!html_response_list_comment_prefix= }
{!html_response_list_comment_suffix= }
{!html_response_table_prefix= }
{!html_response_table_suffix= }
{!html_num_input_prefix= }
{!html_num_input_suffix= }
{!html_num_exception_prefix= }
{!html_num_exception_suffix= }
{!html_var_input_prefix= }
{!html_var_input_suffix= }
{!html_textquestion_input_prefix= }
{!html_textquestion_input_suffix= }
{!END_CD_BLOCK }

The above block of code will clear out any HTML commands from a previously used block.

Call it in prior to a block of code that you want to use like this:

{!SYSTEM,EXECUTE_COMPILER_DIRECTIVE_BLOCK,CLEAR }
{!SYSTEM,EXECUTE_COMPILER_DIRECTIVE_BLOCK,DEFAULT }

Response List Formats

By default, response lists for single-response FIELD questions with fewer than 200 items are presented in a radio button format. Response lists for multi-response FIELD questions with fewer than 200 items are presented in a check box format. Any response list with 200 or more items usually is presented in a drop-down response box format.

These defaults may be changed by embedding the following compiler commands into the Survent specification.  These commands can be used through out the survey and once set, will be how all FIELD questions display until it sees another set of compiler commands.  For example, if you set the FIELD questions to display drop-down boxes, that is how all FIELD questions will display until the HTML commands are changed to display radio buttons or check boxes.

{!HTML_RADIOBUTTONS=#} Number of response items where single response questions are displayed with radio buttons instead of a drop-down response box with a scroll bar.  If the value is set to 1, then a drop-down box will be used.

{!HTML_CHECKBOXES=#/ALL} Number of response items where multi-response questions are displayed with check boxes instead of a drop-down response box with a slide bar (# can be 0 to a very high number.) If this value is set to ALL, then single-response questions use check boxes similar to multi-response questions. If you choose to go with the default setting of 200, you don’t need a command to set them.  If the value is set to 1, then a drop-down box will be used.

Examples:

{!HTML_RADIOBUTTONS=200 }
{!HTML_CHECKBOXES=200 }

The above HTML commands would display radio buttons and check boxes
on the screen for single and multiple response FIELD questions.
{!HTML_RADIOBUTTONS=1 }
{!HTML_CHECKBOXES=1 }

The above HTML commands would display a drop-down box for single and 
multiple response FIELD questions.
{!HTML_CHECKBOXES=ALL }

The above HTML command would display check boxes a single response
FIELD question.

For examples on using HTML and Survox programming techniques see our Features Demo and Advanced Training.