Developing search using Ajax technology. How to catch text input or rather each entered character in the form with the identifier search_text ?

Each character entered into a form is an Ajax request with value search_text.

  • one
  • @entithat onInput same - Misha Saidov
  • To the input field $("input").on("change", e => {...}) - Misha Saidov
  • @MishaSaidov, well, yes, you can and his .. - entithat
  • Post a comment as an answer, please - Denis Heavenly

1 answer 1

 $('#search_text').keyup(function(){ console.log($(this).val()); }); 
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <input type="text" id="search_text"> 

  • Do not tell me how to simultaneously check other identifiers? - Denis Heavenly
  • ideone.com/UQrkZs Identifiers: online, gender, photo - Denis Heavenly
  • one
    If you are talking about type="checkbox" then it is checked via if($("input[name=online]").is(':checked')) {...} - Bert
  • one
    When you enter into the form, create for each checkbox a separate variable whose value will be the result of if, then when sending send the same value to the parameters - Bert