Skip to content

Allows for a dynamic number of input fields within HTML forms using JQuery

License

Notifications You must be signed in to change notification settings

LewisWH/Dynamic-HTML-Form-Inputs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic-HTML-Form-Inputs

Allows for a dynamic number of input fields within HTML forms

Use Case

Useful for forms such as grocery lists, where the amount of input fields may vary

Getting Started

  • Amend the 'action' attribute for the "insert-list" form within index.html to match your target page, such as to "/insert-list.php" for example:
action="/insert-list.php"
  • Within your target file, to extract the submitted data in PHP:
$fieldArray = $_POST['dynamicField'];
  • Amend the max amount of input fields within scripts.js as follows:
const maxField = 25

Screenshots

Example grocery list for a recipe (1)

Example grocery list for a recipe (2)

About

Allows for a dynamic number of input fields within HTML forms using JQuery

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published