Coder Social home page Coder Social logo

cballou / jquery-form-element-repeater-plugin Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 13.0 35 KB

A jQuery plugin for creating repeatable form elements, i.e. an array of input elements with add/remove capabilities.

Home Page: https://www.coreyballou.com/projects/jquery-form-element-repeater-plugin/

License: Other

JavaScript 87.97% HTML 12.03%

jquery-form-element-repeater-plugin's People

Contributors

bitdeli-chef avatar cballou avatar gdixon avatar octi avatar peterhartree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jquery-form-element-repeater-plugin's Issues

'Remove' does not appear

Hello

I have basically the form like in the example readme.
But when I press +, for get duplicated, I see + and - on the last item, but the first item does not get the '-' sign, so basicly I can't remove first element..

Maybe it is the settings issue?

Thanks

repopulate data

I really like the simplicity of this script, I came across it looking for a method of repopulating repeated forms from the database.

Would it be terribly hard to provide an optional json feed and have the form reflect the entries?

Delegate has been deprecated

http://api.jquery.com/delegate/
As of jQuery 3.0, .delegate() has been deprecated. It was superseded by the .on() method since jQuery 1.7, so its use was already discouraged. For earlier versions, however, it remains the most effective means to use event delegation. More information on event binding and delegation is in the .on() method. In general, these are the equivalent templates for the two methods:_

Please change with .on

Uncaught TypeError: Cannot read property 'repeatCount' of undefined

Getting this error, even when testing the example.html :

Uncaught TypeError: Cannot read property 'repeatCount' of undefined
at HTMLButtonElement.addRepeater (jquery.form-repeater.js:232)
at HTMLDivElement.dispatch (jquery.min.js:3)
at HTMLDivElement.i (jquery.min.js:3)

#ReindexingOnAdd Button

How to add ReNumbering functionality on ADD button click ? Which is available in Remove Button click.

clearValues - not used?

Hello,

I can't find anywhere in the code, where clearValues is used... I have some problems that cloning is not clearing the values. Can someone point me in some direction?

Thank you

minItems value?

Not sure if this is an issue with the plugin or the docs or just with my implementation.

I have my first set of fields(index 0) that I am repeating. with minItems set to 1, I can repeat the form field (index 1), but can not remove the repeated fieldset. if I add a second fieldset Index(2) I can remove that one.

If I set minItems to 0 I can remove the fieldset with Index 1. This might be something that the docs could clarify better.

isaFormRepeater does not send select element name value via ajax request

Thanks for your plugin, but i have an issue with it

when i added this

<select id="parent_field_id[1][test_sub1]" name="parent_field_id[1][test_sub1]" class="form-control repeat-el" required>
	<option> {{ ( isset($parentInfo) ) ? $parentInfo->parent_title : 'Choose' }} </option>
	<option value="Mr">Mr</option>
	<option value="Mrs">Mrs</option>
	<option value="Dr">Dr</option>
	<option value="Ms">Ms</option>
	<option value="Master">Master</option>
</select>
<select id="parent_field_id[1][test_sub5]" name="parent_field_id[1][test_sub5]" class="form-control up_type repeat-el" required>
	<option> {{ ( isset($parentInfo) ) ? $parentInfo->relationship : 'Choose' }} </option>
	<option value="Mother">Mother</option>
	<option value="Father">Father</option>
	<option value="Uncle">Uncle</option>
	<option value="Aunty">Aunty</option>
	<option value="Nephew">Nephew</option>
	<option value="Brother">Brother</option>
	<option value="Sister">Sister</option>
	<option value="Guardian"> Guardian </option>
</select>

it repeated the parent elements, but when i send an ajax request, the first parent element displayed

parent_field_id[1][test_sub1]: Choose
parent_field_id[1][test_sub2]:
parent_field_id[1][test_sub3]:
parent_field_id[1][test_sub4]:
parent_field_id[1][test_sub5]: Choose
parent_field_id[1][test_sub6]:
parent_field_id[1][test_sub7]:
parent_field_id[1][test_sub8]:
parent_field_id[1][test_sub9]:
parent_field_id[1][test_sub10]:

but i when i click the add button the cloned form does not display the select element name value.

parent_field_id[2][test_sub2]:
parent_field_id[2][test_sub3]:
parent_field_id[2][test_sub4]:
parent_field_id[2][test_sub6]:
parent_field_id[2][test_sub7]:
parent_field_id[2][test_sub8]:
parent_field_id[2][test_sub9]:
parent_field_id[2][test_sub10]:

Where "[test_sub1]" and "[test_sub5]" are select elements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.