Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature form dynamic select input #83

Conversation

midnight-studios
Copy link
Contributor

Usage

The features these changes provides can be used in different use cases of which will most commonly be utilized by plugins.

Use case example

An example will be a survey form. The admin may wish to create a form that may require numerous form input fields.

Some might be as simple as question and answer consisting of some Question Text and a feedback/answer text input field, however the admin might wish to use more complex feedback options, such as a radio group, checklist or select list. This will require the plugin to support more complex functionality as the admin would be required to add input properties such as option values and labels.

Each Form Input Item may consist of any of the following types:

  • 'select'
  • 'integer'
  • 'html_input'
  • 'html_textarea'
  • 'textarea'
  • 'text'
  • 'checkbox'
  • 'checklist'
  • 'radio'
  • 'fileselect'
  • 'password'
  • 'info'
  • 'color'
  • 'input_group'

Each Form Input will be added dynamically in order to build the form as needed, and each input property will also be required to be added dynamically for some inputs such as lists, may need only two or three list items, while others may be more.

This feature therefor provides support for nested dynamic inputs such as types 'select_input' inside array:array:string.

Additional use case examples will include complex settings for a shopping cart plugin, courier/shipping plugin, layer slider plugin

Changes

This branch contains support for a feature not available in the Official Branch:

Configurations:

  • type = select_input
  • max_number = 4
  • use_fieldset = true / false (Wrap the items in a fieldset)
  • fold = true / false

Supports:

  • 'select'
  • 'integer'
  • 'html_input'
  • 'html_textarea'
  • 'textarea'
  • 'text'
  • 'checkbox'
  • 'checklist'
  • 'radio'
  • 'fileselect'
  • 'password'
  • 'info'
  • 'color'
  • 'input_group'

Related PR

This PR incorporates all the following:

Forum Discussions

http://forums.b2evolution.net/support-dynamic-fields-inside-dynamic-fields#c110631
http://forums.b2evolution.net/feature-request-dynamic-input-groups#c110422

Visual Cues

1
2
3
4
5
7

Additional fixes

fix removing and re-adding items via AJAX callbacks

6

* Note: inc/_core/ui/forms/_form.class.php @see line 3670 comment re radio_input
* Note: skins_adm/bootstrap/_adminUI.class.php @see line 83 comment re js
Delete these for production, used to test with only
* skins/development_skin/
* plugins/development_plugin/
@fplanque fplanque closed this Mar 25, 2020
@fplanque
Copy link
Contributor

I did not intend to close this, I just renamed the branch to old/develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants