Popular Articles

  1. Disable Radio Button Once Option is Selected

    This JavaScript will allow you to disable a question once an answer is selected. This comes in handy if you would like to prevent your users from changing their answers. We do have a built in feature that will hide a question once it is answered. Th...
  2. Hide Other Textbox Until Option is Clicked

    In this tutorial we'll cover how to display an Other Textbox in a Radio Button or Checkbox question only after the associated answer option has been clicked. Many users want their survey to be as clean as possible. Only showing an other field ...
  3. Using Continuous Sum Total in a Merge Code

    There isn't a built in way to use the total of the Continuous Sum question in another question. Fret not! There's a custom script for that! In this tutorial we'll show you how to use a custom script to populate a hidden value so that you can use the...
  4. sgapiSetRequired(%%questionID, true/false)

    This function toggles the required status of a question. Example In this example, if no questions were answered on page ID 1, then question ID 4 is required. In case the respondent goes back and answers a question on page ID 1, the scri...
  5. sgapiSetTableOrderByTable(%%tableID,%%refID,%%language)

    This function accepts two table Question IDs and orders the rows of the table in %%tableID by the table in %%refID. This allows you to maintain randomization order across tables in your survey. The row headers for both tables must be identical. ...
  6. sgapiCurrentPageSKU()

    This function will return the sku of the current page. Example The below example outputs the current page sku to the page. %%output .= sgapiCurrentPageSKU();
  7. sgapiArray_Rand(%%array,%%number)

    This function is the equivalent of the array_rand function in PHP. Picks one or more random entries out of an array, and returns the key (or keys) of the random entries. %%arr = the defined array. %%number = the number of returned array ...
  8. sgapiTextPDF(%%pdf, %%text, %%size, %%options, %%test)

    This function adds text to the given PDF. Parameters %%pdf - The title of the PDF you are creating. %%text - The text to add to the PDF. %%size - The font size (default is 12 ). %%option = array () - 'left' => number - gap to leav...
  9. sgapiRandomizeTable(%%questionID)

    This function shuffles the rows of the given table. Example In the below example we randomize the rows of table question ID 2. sgapiRandomizeTable(2);
  10. sgapiListAdd(%%surveyID, %%item)

    This function posts a response to the given survey using the array of items. This is equivalent to creating a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Example The below example scri...