The standard approach in surveys and the web for password text fields is that the text typed in is replaced, usually, by * symbols. The following instructions and script will allow you to set this up for your surveys.
Note: This script will only work if the respondent has scripting switched on in their browser.
Example
Detailed Steps
Creation and setup of questions:
- In Power Survey Authoring, go to the Questionnaire tab of your study.
- Add a new Open End question.
Adding the script
- Open Notepad or a similar text editor
- Copy and paste the script below into you text editor.
- Change the text OPENEND to the name of the open end question in your survey.
- In the power survey, locate the Open End question.
- In the Scripting section of the Open End question, click Edit Scripts.
- Copy the modified script from your text editor into the JavaScript tab.
- Click Save.
- Click Validate and test your survey.
Script
<script src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript">
/*
Script Name: How do I display bullet characters instead of text in a password field?
To ensure your script works as expected, always copy the original script from the script library found in the
support portal. Failure to use the most up to date script from the script library may cause unexpected results.
*/
</script>
<SCRIPT>
var $j = jQuery.noConflict();
PwdToStar($j('#i[%(OPENEND.Id)%]VerbatimQuestion')); // edit this line
function PwdToStar(obj){
if(obj != null){
var pw = obj;
var newPw = $j("<INPUT/>");
newPw.attr('name', pw.attr('name'));
newPw.attr('type', 'password');
newPw.attr('size', '15');
newPw.attr('id', pw.attr('id'));
newPw.attr('class', pw.attr('class'));
newPw.attr('value', pw.attr('value'));
newPw.attr('onkeydown', 'fnTrapKD("NextButton",event)');
newPw.attr('style','width:150px');
pw.replaceWith(newPw);
}
}
</SCRIPT>
More Information
Read this WebHelp article to learn more about Create an Open End Question.
Comments
0 comments
Article is closed for comments.