Getting data from a range of values

Getting data from a range of values

I'm trying to get a range of numbers depending on what the user inputs.
I have customer.js which has the customer name and shoe size and what I would like is to get a range of shoe sizes depending
on what the user puts in.

For example. A user puts in the first textbox 5 and in the second textbox 9 I want the customers that is between 5 and 9,
but also including 5 and 9 to be displayed.

I've only gotten as far as this.

my html

  1. <form id="shoe_size">
  2.     <label for="size">Enter sizes</label>
  3.     <input type="text" name="size1" class="size1">
  4.     <input type="text" name="size2" class="size2">
  5.     <input type="submit" value="Search" class="submit">
  6. </form>



my jquery

  1. $('#shoe_size').on('submit', function(){
  2.     var size1 = $('.size1').val();
  3.     var size2 = $('.size2').val();
  4.     $('.table tr').each(function(){
  5.         var size = 'false';
  6.         $(this).each(function(){
  7.             if(size1 <= size2){
  8.                 found = 'true';
  9.             }
  10.         })
  11.         if(size == 'true'){
  12.             $(this).show();
  13.         }else{
  14.             $(this).hide();
  15.         }
  16.     });
  17. });