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

Pre-fill a few lines, and use the repeat button to create more lines #101

Closed
rudddy opened this issue Jan 13, 2019 · 1 comment
Closed

Comments

@rudddy
Copy link

rudddy commented Jan 13, 2019

I would like to be able to pre-fill a few lines from my database, and use the repeat button to create more lines. Only by clicking on the button, the form is always filled with the data from the first line when I would like to have it empty.

The code is available here: https://jsfiddle.net/vq1wLxs3/

Thanks

@rudddy
Copy link
Author

rudddy commented Jan 17, 2019

I got it with

`
$('.repeater').repeater({

				// (Optional)

				// "defaultValues" sets the values of added items.  The keys of

				// defaultValues refer to the value of the input's name attribute.

				// If a default value is not specified for an input, then it will

				// have its value cleared.

				defaultValues: {

					'name1': '',

                                            'name2': ''

				}

			});

`

@rudddy rudddy closed this as completed Jan 17, 2019
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

No branches or pull requests

1 participant