Here is an example of how you could use javascript buttons on a page. Inside a info node on the page if you add the name of your function. ^mainpage()^ In a script node if you name the function the same and enter the code – function mainpage() { var outputHTML = “”; outputHTML += […]
Change Reportal Label based on Text in Div
This will show you how to change the text label inside a div on the page based on another string on the page. First it’s getting all Div elements and then looking into the innerHTML for the word “open”. If its found change the background to red – this is used to help figure out […]
Small image in survey, click to enlarge
This code will add a small image to survey page and will enlarge the image if the user clicks on it. HTML in survey question × Style script in the instruction node – JavaScript node – // Get the modal var modal = document.getElementById(‘myModal’); // Get the image and insert it inside the modal – […]
Confirmit array If statement
Quick code to check a selection of variables for a code of 2 which is a fail. Checks all of the top variables [‘qnr_main_section1_PF’……..etc. If any of these are marked as code 2 and if so set var qnT = f(‘qnr_overall_QA_PF’); as 2 which is overall fail Else set to 1 which is pass var qIDsToCheck = […]
The Bitcoin Referral Page
Here is the Bitcoin/Cryptocurrency MoDCore referral page. Below is a selection of sites to gain free coins in order of our favourite ones. JSEcoin – Browswer Mining Jsecoin Mining – Web Masters JSEcoin is great for webmasters who own a website. On this site you can mine coins using your browswer or add in script […]
Custom navigation button labels
This will let you change the label on a navigation button during a survey. Select survey settings, layout and inside the next button label put – ^f(‘nextBtn’).valueLabel()^ Within the survey you will need a hidden single question called – nextBtn This will need to have the required labels for the button Then script node to […]
Validation Scripts – RegExr
Here are a selection of RegExr validation scripts to use with error messages. Correct Email format Checks to see if a email address has been formatted correctly if(!IsEmail(f(CurrentForm()))) { RaiseError(); SetQuestionErrorMessage(9,”Please provide a valid email address.”); } Correct Telephone format Checks a open question has 11 digits without spaces, i.e Phone number […]
Merge string and respid
Merging a string with the respid of the respondent to create a unquie ID which is targetable by a survey, email or reportal report. Create a new DP rule and select the survey and add in a filter, the field we are populating will be “userid” so make sure this field is empty using the […]
Visual Countdown for open text field length
This will show you how to add a twitter like character count down on to any open question within your survey. First off we want to enable the jquery library in your survey. Survey themes, select the one you are using. In the external Javascript URL paste this address into it //ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js This script will […]
Printing from Capi – Page Breaks
How to force page breaks when printing from Capi We have been working with printing from the Capi console (Confirmits Offline completion app). We are having to print off a results page. There is a couple of different sections ont he print out that require a start of a new page when printing. This will […]