Check out the LimeSurvey source code on GitHub!

Keypad for 'Other' text input

More
5 years 6 months ago #62659 by Earl
Hi,

since 1.91 there is a great feature for using LS without keyboard: keypad
As far as I have seen it is only working on shorttext or multiple shorttext questions.
How can I get this to work for other questions that require text input?
In quanda.php I found this:

if ($thissurvey=='Y')
{
vIncludeKeypad();
$kpclass = "text-keypad";
}
else
{
$kpclass = "";
}
for shorttext and mutiple shorttext but not for 'Other' option or list with comments.
The problem is I have no idea of php.
Can anybody help me?

Thanks in advance!
Earl

Please Log in to join the conversation.

More
5 years 6 months ago #62699 by tpartner
I'm not sure what the thinking was behind only applying the keyboard to those question types, but adding the following to the end of template.js should apply it to all inputs with a class of "text" and all textareas.
$(document).ready(function() {
 
		// Set up the spacer for the top keyboard row
		var spacer = $.keypad.HALF_SPACE;
		for(var i = 0; i != 8; ++i) spacer += $.keypad.SPACE;
 
		// Apply the virtual keyboard to all text inputs and textareas
		$('input.text, textarea').keypad({
			showAnim: 'fadeIn',
			keypadOnly: false,
			layout: [
				spacer + $.keypad.CLEAR + $.keypad.CLOSE, $.keypad.SPACE,
				'!@#$%^&*()_=' + $.keypad.HALF_SPACE + $.keypad.BACK,
				$.keypad.HALF_SPACE + '`~[]{}<>\\|/' + $.keypad.SPACE + $.keypad.SPACE + '789',
				'qwertyuiop\'"' + $.keypad.HALF_SPACE + $.keypad.SPACE + '456',
				$.keypad.HALF_SPACE + 'asdfghjkl;:' + $.keypad.SPACE + $.keypad.SPACE + '123',
				$.keypad.SPACE + 'zxcvbnm,.?' + $.keypad.SPACE + $.keypad.SPACE + $.keypad.HALF_SPACE + '-0+',
				$.keypad.SHIFT + $.keypad.SPACE_BAR + $.keypad.ENTER
				]
		});
 
	});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 6 months ago #62783 by Earl
Thank You!!!

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form