JavaScript -> .repeaterVal() doesn't return data from fields <input type="number">
See original GitHub issueHi, 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>
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
HTML input type number does not return value when having ...
I have tried to use type="tel" , but it does not show dot comma values. Then decide to use type="number", its allows all...
Read more >How to force Input field to enter numbers only using JavaScript
Now forcing input field type=”text” to accept numeric values only by using Javascript or jQuery. You can also set type=”tel” attribute in the ......
Read more ><input type="time"> - HTML: HyperText Markup Language | MDN
A Boolean attribute which, if present, means this field cannot be edited by the user. Its value can, however, still be changed by...
Read more >HTML Input Types - W3Schools
<input type="text"> defines a single-line text input field: ... If you omit the submit button's value attribute, the button will get a default...
Read more >How to Allow Only Positive Numbers in the Input Number Type
Solutions with HTML attributes. As we know, the <input type="number"> specifies a field for entering a number. If you want to restrict the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@ahazeemi check this PR with add support for input type=“number” https://github.com/DubFriend/jquery.repeater/pull/94