18 require_once dirname(__FILE__).
'/../form_question_type_text/form_question_type_text.inc';
19 require_once SQ_FUDGE_PATH.
'/general/www.inc';
61 return Array(
'comparison',
'integer',
'length');
83 if (is_null($answer)) $answer = $this->
getValue();
85 if (!empty($answer)) {
86 $req_rule = Array(
'rule_code' =>
'numeric',
'operator' => 1);
87 array_unshift($this->vars[
'rules'][
'value'], $req_rule);
90 if ($this->
attr(
'is_int')) {
91 $req_rule = Array(
'rule_code' =>
'integer',
'operator' => 1);
92 array_unshift($this->vars[
'rules'][
'value'], $req_rule);
96 $ok = parent::hasValidValue($answer, $mute_errors);
98 if (!empty($answer)) {
99 if ($this->
attr(
'is_int')) {
100 array_shift($this->vars[
'rules'][
'value']);
102 array_shift($this->vars[
'rules'][
'value']);
123 $req_rule = Array(
'rule_code' =>
'numeric',
'operator' => 1);
124 array_unshift($this->vars[
'rules'][
'value'], $req_rule);
127 if ($this->
attr(
'is_int')) {
128 $req_rule = Array(
'rule_code' =>
'integer',
'operator' => 1);
129 array_unshift($this->vars[
'rules'][
'value'], $req_rule);
132 $code = parent::generateJSCode();
134 if ($this->
attr(
'is_int')) {
135 array_shift($this->vars[
'rules'][
'value']);
137 array_shift($this->vars[
'rules'][
'value']);