Welcome, Guest
Username: Password: Remember me

TOPIC: Keypad for 'Other' text input

Keypad for 'Other' text input 2 years 9 months ago #62659

  • Earl
  • Earl's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 1
  • Karma: 3
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
The administrator has disabled public write access.

Re: Keypad for 'Other' text input 2 years 9 months ago #62699

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Aw: Re: Keypad for 'Other' text input 2 years 9 months ago #62783

  • Earl
  • Earl's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 1
  • Karma: 3
Thank You!!!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.109 seconds
Donation Image