jquery.repeater
jquery.repeater copied to clipboard
.setList not setting date input nor a number input
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
@MrJoshFisher I am facing a similar problem, did you find a solution?
Edit: I am facing the exact same problem
#112 For future developers who run into this problem. I did not set the type property on the input which caused the issue.
@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.
Now I'm currently facing the same problem, is there already any solution for this?
Now I'm currently facing the same problem, is there already any solution for this?
Afraid not I ended up using a different library
I have made a simple change and that works
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
I have made a simple change and that works
This fixed the issue for me. Thank you.