Custom Form Builder

Hi

I need to built a custom form builder like,

http://www.wufoo.com/form-builder/

Please suggest if any module avaliable.

or database structure to implement.

if you find something let me know! i have to make one too. I have been pushing it off. I made one in yii 1 but i can’t use it so i have to start over.

Kartik form builder but it’s not 100% what you need.

The problem is that since it’s in mysql it made it hard to make it be truly dynamic that’s why there are 4 tables.

It works and works well with the structure below.

I’m using nosql this time and am just going to save everything in one in a json array and output it that way in one table.

Validation is a pain you have to do loops in your rules but yii2 has a dynamic model class that should help with this. It appears you could make the whole thing with the dynamic model class fairly easily.

As for as the display i just use two drag and drop widgets.

Anyways here is the old table structor




SET FOREIGN_KEY_CHECKS=0;


the actual form

CREATE TABLE IF NOT EXISTS `form` (

  `form_id` int(4) unsigned NOT NULL,

  `form_title` char(100) NOT NULL,

  `form_desc` char(255) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8;


//this is the fields that were filled out.

CREATE TABLE IF NOT EXISTS `form_answers` (

  `mf_answers_id` int(4) unsigned NOT NULL,

  `mf_answers_product_id` int(4) unsigned NOT NULL,

  `mf_answers_equipment_id` int(4) unsigned NOT NULL,

  `mf_answers_form_id` int(4) unsigned NOT NULL,

  `mf_answers_question_id` int(4) unsigned NOT NULL,

  `mf_answers_user_id` int(4) unsigned NOT NULL,

  `mf_answers_answer` text NOT NULL,

  `mf_answers_date` datetime NOT NULL,

  `mf_answers_comment` char(255) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8;


//these are the dropdown values / checkbox / select values

CREATE TABLE IF NOT EXISTS `form_dropdown_values` (

  `mf_values_id` int(4) unsigned NOT NULL,

  `mf_values_question_id` int(4) unsigned NOT NULL,

  `mf_values_value` char(50) NOT NULL,

  `mf_values_equipment_status` tinyint(1) unsigned DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8;


//these are the fields 

CREATE TABLE IF NOT EXISTS `form_questions` (

  `mf_question_id` int(4) unsigned NOT NULL,

  `mf_question_form_id` int(4) unsigned NOT NULL,

  `mf_question_title` char(50) NOT NULL,

  `mf_question_type` char(20) NOT NULL DEFAULT 'text',

  `mf_question_placeholder` char(40) DEFAULT NULL,

  `mf_question_required` tinyint(1) unsigned NOT NULL DEFAULT '1',

  `mf_question_position` tinyint(1) unsigned NOT NULL,

  `mf_question_field_size` int(4) unsigned NOT NULL DEFAULT '40',

  `mf_question_help_text` char(50) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8;


ALTER TABLE `form`

  ADD PRIMARY KEY (`form_id`), ADD KEY `form_product_id` (`form_product_id`);


ALTER TABLE `form_answers`

  ADD PRIMARY KEY (`mf_answers_id`), ADD KEY `mf_answers_product_id` (`mf_answers_product_id`,`mf_answers_equipment_id`,`mf_answers_form_id`,`mf_answers_question_id`,`mf_answers_user_id`);


ALTER TABLE `form_dropdown_values`

  ADD PRIMARY KEY (`mf_values_id`), ADD KEY `mf_values_question_id` (`mf_values_question_id`,`mf_values_equipment_status`);


ALTER TABLE `form_questions`

  ADD PRIMARY KEY (`mf_question_id`), ADD KEY `mf_question_form_id` (`mf_question_form_id`);


SET FOREIGN_KEY_CHECKS=1;



That is about as much as I can give you.