public function GetFieldInput($id, &$params, $returnid) { $mod = $this->form_ptr->module_ptr; $js = $this->GetOption('javascript', ''); $check_value = $this->_check_value(); $output = array(); $box_label = ''; $text_label = ''; if (!$this->Value['box'] && $this->GetOption('is_checked', '0') == '1') { $this->Value['box'] = 't'; } if (strlen($this->GetOption('box_label', '')) > 0) { $box_label = '<label for="' . $this->GetCSSId('_0') . '">' . $this->GetOption('box_label') . '</label>'; } if (strlen($this->GetOption('text_label', '')) > 0) { $text_label = '<label for="' . $this->GetCSSId('_1') . '">' . $this->GetOption('text_label') . '</label>'; } $obj = new stdClass(); $obj->name = $box_label; $obj->input = $mod->CreateInputCheckbox($id, 'fbrp__' . $this->Id . '[box]', 't', $this->Value['box'], $js . $this->GetCSSIdTag('_0')); $output[] = $obj; if ($this->GetOption('show_textfield')) { $val = ''; if ($check_value['text']) { $val = $this->Value['text']; } $obj = new stdClass(); $obj->name = $text_label; $obj->input = formbuilder_utils::create_input_text($id, $this->GetCSSId() . '[text]', $val, 25, 25, $js, 'text', $this->isRequired(), 1); $output[] = $obj; } return $output; }
public function GetFieldInput($id, &$params, $returnid) { $val = ''; $length = $this->GetOption('length') < 25 ? $this->GetOption('length') : 25; $js = $this->GetOption('javascript', ''); $ro = ''; $html5 = ''; if ($this->GetOption('html5', '0') == '1') { $val = $this->Value; $html5 = ' placeholder="' . $this->GetOption('default') . '"'; } else { $val = $this->HasValue() ? $this->Value : $this->GetOption('default'); if ($this->GetOption('clear_default', '0') == 1) { $js .= ' onfocus="if(this.value==this.defaultValue) this.value=\'\';" onblur="if(this.value==\'\') this.value=this.defaultValue;"'; } } if ($this->GetOption('readonly', '0') == '1') { $ro = ' readonly="readonly"'; } switch ($this->ValidationType) { default: return formbuilder_utils::create_input_text($id, $this->GetCSSId(), $val, $length, $this->GetOption('length'), $js . $ro . $html5, 'text', $this->IsRequired()); break; case 'usphone': return formbuilder_utils::create_input_text($id, $this->GetCSSId(), $val, $length, $this->GetOption('length'), $js . $ro . $html5, 'tel', $this->IsRequired()); break; case 'email': return formbuilder_utils::create_input_text($id, $this->GetCSSId(), $val, $length, $this->GetOption('length'), $js . $ro . $html5, 'email', $this->IsRequired()); break; } }
public function GetFieldInput($id, &$params, $returnid) { $js = $this->GetOption('javascript', ''); $val = ''; if ($this->Value) { $val = $this->Value; } if ($this->GetOption('hide', '1') == '0') { return formbuilder_utils::create_input_text($id, $this->GetCSSId(), $val, $this->GetOption('length'), 255, $js, 'text', $this->isRequired()); } else { return formbuilder_utils::create_input_text($id, $this->GetCSSId(), $val, $this->GetOption('length'), 255, $js, 'password', $this->isRequired()); } }
public function GetFieldInput($id, &$params, $returnid) { $mod = $this->form_ptr->module_ptr; $js = $this->GetOption('javascript', ''); $sibling_id = $this->GetOption('siblings', ''); $hidebuttons = $this->GetOption('hidebuttons', ''); if (!is_array($this->Value)) { $vals = 1; } else { $vals = count($this->Value); } foreach ($params as $pKey => $pVal) { if (substr($pKey, 0, 9) == 'fbrp_FeX_') { $pts = explode('_', $pKey); if ($pts[2] == $this->Id || $pts[2] == $sibling_id) { // add row $this->Value[$vals] = ''; $vals++; } } elseif (substr($pKey, 0, 9) == 'fbrp_FeD_') { $pts = explode('_', $pKey); if ($pts[2] == $this->Id || $pts[2] == $sibling_id) { // delete row if (isset($this->Value[$pts[3]])) { array_splice($this->Value, $pts[3], 1); } $vals--; } } } // Input fields $ret = array(); for ($i = 0; $i < $vals; $i++) { $length = $this->GetOption('length') < 25 ? $this->GetOption('length') : 25; $thisRow = new stdClass(); $thisRow->input = formbuilder_utils::create_input_text($id, $this->GetCSSId() . '[]', $this->Value[$i], $length, $this->GetOption('length'), $js, 'text', false, $i); if (!$hidebuttons) { $thisRow->op = $mod->fbCreateInputSubmit($id, 'fbrp_FeD_' . $this->Id . '_' . $i, $this->GetOption('del_button', 'X'), $this->GetCSSIdTag('_del_' . $i) . ($vals == 1 ? ' disabled="disabled"' : '')); } array_push($ret, $thisRow); } // Add button $thisRow = new stdClass(); if (!$hidebuttons) { $thisRow->op = $mod->fbCreateInputSubmit($id, 'fbrp_FeX_' . $this->Id . '_' . $i, $this->GetOption('add_button', '+'), $this->GetCSSIdTag('_add_' . $i)); } array_push($ret, $thisRow); return $ret; }
public function GetFieldInput($id, &$params, $returnid) { $val = ''; $js = $this->GetOption('javascript', ''); $html5 = ''; if ($this->GetOption('html5', '0') == '1') { $val = $this->Value; $html5 = ' placeholder="' . $this->GetOption('default') . '"'; } else { $val = $this->HasValue() ? $this->Value : $this->GetOption('default'); if ($this->GetOption('clear_default', '0') == 1) { $js .= ' onfocus="if(this.value==this.defaultValue) this.value=\'\';" onblur="if(this.value==\'\') this.value=this.defaultValue;"'; } } return formbuilder_utils::create_input_text($id, $this->GetCSSId(), $val, 25, 128, $js . $html5, 'text', $this->IsRequired()); }
public function GetFieldInput($id, &$params, $returnid) { $mod = $this->form_ptr->module_ptr; $js = $this->GetOption('javascript', ''); $ro = ''; $val = ''; if ($this->GetOption('readonly', '0') == '1') { $ro = ' readonly="readonly"'; } if ($this->Value) { $val = $this->Value; } if ($this->GetOption('hide', '1') == '0') { return formbuilder_utils::create_input_text($id, $this->GetCssId(), $val, $this->GetOption('length'), 255, $js . $ro, 'text', $this->isRequired()); } else { return formbuilder_utils::create_input_text($id, $this->GetCssId(), $val, $this->GetOption('length'), 255, $js . $ro, 'password', $this->isRequired()); } }
public function GetFieldInput($id, &$params, $returnid) { $mod = $this->form_ptr->module_ptr; $js = $this->GetOption('javascript', ''); $val = ''; $rq = ''; $html5 = ''; if ($this->GetOption('html5', '0') == '1') { $val = $this->Value[0]; $html5 = ' placeholder="' . $this->GetOption('default') . '"'; } else { $val = $this->Value[0] ? $this->Value[0] : $this->GetOption('default'); if ($this->GetOption('clear_default', '0') == 1) { $js .= ' onfocus="if(this.value==this.defaultValue) this.value=\'\';" onblur="if(this.value==\'\') this.value=this.defaultValue;"'; } } $input = formbuilder_utils::create_input_text($id, $this->GetCSSId(), $val, 25, 128, $js . $html5, 'email', $this->IsRequired()); if ($this->GetOption('send_user_copy', 'n') == 'c') { $input .= formbuilder_utils::create_input_checkbox($id, $this->GetCSSId(), 1, 0, '', 1); $input .= formbuilder_utils::create_label($id, $this->GetCSSId('_1'), $this->GetOption('send_user_label', $mod->Lang('title_send_me_a_copy'))); } return $input; }