https://github.com/sammarks/drupal-form-api-add-remove
Example repository for AJAX add/remove functionality on Drupal forms.
https://github.com/sammarks/drupal-form-api-add-remove
Last synced: 2 months ago
JSON representation
Example repository for AJAX add/remove functionality on Drupal forms.
- Host: GitHub
- URL: https://github.com/sammarks/drupal-form-api-add-remove
- Owner: sammarks
- License: mit
- Created: 2014-06-17T16:09:34.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-17T16:23:58.000Z (almost 11 years ago)
- Last Synced: 2025-02-02T16:56:13.528Z (4 months ago)
- Language: PHP
- Size: 148 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Drupal Form API Add/Remove Example (with AJAX)
This module is an expansion of Drupal's AJAX add more example ([found here](https://api.drupal.org/api/examples/ajax_example%21ajax_example_graceful_degradation.inc/function/ajax_example_add_more/7)).
This example expands it to allow the user to remove specific rows instead of removing just the last row. It also bundles it up into a single module so it's much easier to read.
This repository is meant to serve as an example, and as such isn't intended to be used on a production website.
You could extend this module and add an implementation of `hook_schema` and use `drupal_write_record` to store the contents of the form in the database.