Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82442

Trying to use regex to search with a number

$
0
0

So I have a table with username and number. I want to search an exact number e.g. 2 but when I use the regular .search() it gets me anything that has the number 2 (22, 12, 2...) in it. I only want to get cells that are == "2" to show up.

Here is what I tried so far but it's not working.

$('#submitbtn').on('click', function() {
var dateselected = $("#contestdate").val();
$('#example').DataTable().column(1).search("^" + dateselected + "$", true, false).draw();
});

Thanks


Viewing all articles
Browse latest Browse all 82442

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>