DubFriend / jquery.repeater

Create a repeatable group of input elements
MIT License
390 stars 192 forks source link

.setList not setting date input nor a number input #175

Open MrJoshFisher opened 1 year ago

MrJoshFisher commented 1 year ago

Hello all,,

I'm having an issue with the setList function whereby its not setting the values for a number field nor a date field,

<input type="number" name="pet_treat" value="" class="form-control" />
<input type="date" name="pet_birthday" value="" class="form-control" />

setList(
  [
    {
      "pet_treat": "2",
      "pet_birthday": "18-05-2020",
    }
   ]
)

end up getting the error:

jquery.min.js?ver=3.6.1:2 Uncaught TypeError: Cannot read properties of undefined (reading 'set')

it works if I change the inputs to type text, select or checkbox which work fine, just for some reason date and number fields cause the error

Any advice?

Cheer

adeel94mirza commented 1 year ago

@MrJoshFisher I am facing a similar problem, did you find a solution?

Edit: I am facing the exact same problem

adeel94mirza commented 1 year ago

112 For future developers who run into this problem. I did not set the type property on the input which caused the issue.

MrJoshFisher commented 1 year ago

@MrJoshFisher I am facing a similar problem, did you find a solution?

Edit: I am facing the exact same problem

No I didn't, I ended up using a different library entirely which was the basic jquery repeater library.

bagus-dev commented 1 year ago

Now I'm currently facing the same problem, is there already any solution for this?

MrJoshFisher commented 1 year ago

Now I'm currently facing the same problem, is there already any solution for this?

Afraid not I ended up using a different library

nicknicknickcheng commented 1 year ago

Screenshot 2023-07-20 at 3 06 55 AM

I have made a simple change and that works

its-sangam commented 9 months ago

Actually input type date and number is missing in the bundle file, so we can solve the issue by adding simple codes in 3 places.

nu = function (a) { var b = {}, c = x(a, b); return ( (c.getType = function () { return "number"; }), c ); }, dt= function (a) { var b = {}, c = x(a, b); return ( (c.getType = function () { return "date"; }), c ); }, in variable declation section

        `number:nu,
         date:dt` in function A  variable assignment

: f.is('input[type="number"]') ? i("number", f) : f.is('input[type="date"]') ? i("date", f) and i("number", 'input[type="number"]'), i("date", 'input[type="date"]'), in return of function A

thebradleysanders commented 8 months ago

Screenshot 2023-07-20 at 3 06 55 AM

I have made a simple change and that works

This fixed the issue for me. Thank you.