$(document).ready(function(){
    //alert('hai');
    $("#getweightbutton").click(function(){
        var query=1;
        $.ajax({  
             url:"ajaxpath/search.php",  
             method:"POST",  
             data:{query:query},
             success:function(data)  
             {  
                  $('#getweightadd').val("");  
                  $('#getweightadd').val(data);  
                  emptyvehiclesprocess1();
                  chkempty=$('#getweightadd').val();
                  if($.isNumeric(chkempty)){
                  $('#form1').submit();
                  }
                  else{
                  alert("Check Weight Machine Connection");
                  $('#getweightbutton').focus();
                  return false;
                  }
              //alert(a);
              $("#getweightadd").css("border","1px solid skyblue");
              $("#getweightadd").css("box-shadow","2px 1px 3px 1px skyblue");
           }
                        });
    });
    $("#getweightbutton").keyup(function(){
        var query=1;
        $.ajax({  
             url:"ajaxpath/search.php",  
             method:"POST",  
             data:{query:query},
             success:function(data)  
             {  
                  $('#getweightadd').val("");  
                  $('#getweightadd').val(data);  
                  emptyvehiclesprocess1();
                  chkempty=$('#getweightadd').val();
                  if($.isNumeric(chkempty)){
                  $('#form1').submit();
                  }
                  else{
                  alert("Check Weight Machine Connection");
                  $('#getweightbutton').focus();
                  return false;
                  }
              //alert(a);
              $("#getweightadd").css("border","1px solid skyblue");
              $("#getweightadd").css("box-shadow","2px 1px 3px 1px skyblue");
           }
                        });
    });
    });




    $(document).ready(function(){
        //alert('hai');
        $(".getweightbuttonedit").click(function(){
            var oldcode=$(this).closest('.row').find('#editget').val();
            // alert(oldcode);
            var query=1;
            $.ajax({  
                 url:"ajaxpath/search.php",  
                 method:"POST",  
                 data:{query:query},
                 success:function(data)  
                 {  
                      $('.getweightedit'+oldcode).val("");  
                      $('.getweightedit'+oldcode).val(data);  
                      emptyvehiclesprocess1();
                      chkempty=$('#getweightadd').val();
                      if($.isNumeric(chkempty)){
                      $('#form1').submit();
                      }
                      else{
                      alert("Check Weight Machine Connection");
                      $('#getweightbutton').focus();
                      return false;
                      }
     }
                            });
        });
        $("#getweightbuttonedit").keyup(function(){
            var query=1;
                $.ajax({  
                     url:"ajaxpath/search.php",  
                     method:"POST",  
                     data:{query:query},
                     success:function(data)  
                     {  
                          $('#getweightadd').val("");  
                          $('#getweightadd').val(data);  
						  emptyvehiclesprocess1();
						  chkempty=$('#getweightadd').val();
						  if($.isNumeric(chkempty)){
						  $('#form1').submit();
						  }
						  else{
						  alert("Check Weight Machine Connection");
						  $('#getweightbutton').focus();
						  return false;
						  }
         }
                            });
        });
        });