Hello,
we would like to create a numerical input question which is has to be width 22 characters. But, Limesurvey doesn't accept more than 20 characters.
As you can see the following code, the maxsize properties controlling the input value which has been set as 20. So, my question is, if we change that properties, the script can continue the work?
function do_numerical($ia)
{
global $clang;
if ($ia[8] == 'Y')
{
$checkconditionFunction = "checkconditions";
}
else
{
$checkconditionFunction = "noop_checkconditions";
}
$qidattributes=getQuestionAttributes($ia[0],$ia[4]);
if (trim($qidattributes['prefix'])!='') {
$prefix=$qidattributes['prefix'];
}
else
{
$prefix = '';
}
if (trim($qidattributes['suffix'])!='') {
$suffix=$qidattributes['suffix'];
}
else
{
$suffix = '';
}
if (trim($qidattributes['maximum_chars'])!='')
{
$maxsize=$qidattributes['maximum_chars'];
if ($maxsize>20)
{
$maxsize=20;
}
}
else
{
$maxsize=20; // The field length for numerical fields is 20
}
if (trim($qidattributes['text_input_width'])!='')
{
$tiwidth=$qidattributes['text_input_width'];
}
else
{
$tiwidth=10;
}
// --> START NEW FEATURE - SAVE
$answer = "<p class=\"question\">\n\t$prefix\n\t<input class=\"text\" type=\"text\" size=\"$tiwidth\" name=\"$ia[1]\" "
. "id=\"answer{$ia[1]}\" value=\"{$_SESSION[$ia[1]]}\" alt=\"".$clang->gT('Answer')."\" onkeypress=\"return goodchars(event,'0123456789.')\" onchange='$checkconditionFunction(this.value, this.name, this.type)'"
. "maxlength=\"$maxsize\" />\n\t$suffix\n</p>\n";
if ($qidattributes['hide_tip']==0)
{
$answer .= "<p class=\"tip\">".$clang->gT('Only numbers may be entered in this field')."</p>\n";
}