DubFriend / jquery.repeater

Create a repeatable group of input elements
MIT License
389 stars 191 forks source link

JavaScript -> .repeaterVal() doesn't return data from fields <input type="number"> #91

Open RubenMartins opened 6 years ago

RubenMartins commented 6 years ago

Hi, tried to get the data form all fields in javascript using $(".repeater").repeaterVal(); and I found out that the doesn't get returned by this.

Can you please check?

Example:

<form class="repeater">
    <div data-repeater-list="group-a">
      <div data-repeater-item>
        <input type="text" name="text-input" value="A"/>
        <input type="number" name="number-input" value="1"/>
        <input data-repeater-delete type="button" value="Delete"/>
      </div>
    </div>
    <input data-repeater-create type="button" value="Add"/>
    <input type="button" value="Check data" onclick="checkData()" />
</form>

<script src="path/to/jquery.js"></script>
<script src="path/to/jquery.repeater/jquery.repeater.js"></script>
<script>
    $(document).ready(function () {
        $('.repeater').repeater();

        function checkData(){
          let data = $(".repeater").repeaterVal();
          console.log(data);
        }
    });
</script>
ahazeemi commented 6 years ago

Hi, I am facing the same problem. Did you find out a solution for this? Thanks!

RubenMartins commented 6 years ago

@ahazeemi check this PR with add support for input type="number" https://github.com/DubFriend/jquery.repeater/pull/94

SmallSurvival commented 4 years ago

Hey budies you can used this $('#').val(window.id);

$(this).slideUp(deleteElement);

console.log($('.repeater').repeaterVal());
Waqar0266 commented 4 years ago

Hi, $('.repeater-medicationtime').repeaterVal() by using this I want to get the values from fields but it didnot get values from fields of type time and date

jeni1616 commented 4 years ago

If anyone is facing same issue, download whole repeater files, in that you should find jquery.input.js file, replace it with this one: https://pastebin.com/ezrQ412T

It supports date and number both, I created date code from this trick: https://github.com/DubFriend/jquery.repeater/pull/94/commits/8c709d074ed5f0ad4463a51fec51e785f6dbd299

Make sure to include lib.js file as well. download whole repeater files and you should see this file in src folder.

FlorianTSUALA commented 3 years ago

Any anwser don't work for me. ` <!DOCTYPE html>

Repeater jquery.repeater

Repeater

`

FlorianTSUALA commented 3 years ago

If anyone is facing same issue, download whole repeater files, in that you should find jquery.input.js file, replace it with this one: https://pastebin.com/ezrQ412T

It supports date and number both, I created date code from this trick: 8c709d0

Make sure to include lib.js file as well. download whole repeater files and you should see this file in src folder.

Don't work for me; i can't display nor date type nor number type. Please help me