dimanche 31 mars 2019

How to send Single Input Field value to Controller with JQuery in Laravel

I want to send a single input form value to Database with JQuery in Laravel.

Here is the Input Field :

     <input type="text" id="comment">

     <button id="cmntSubmit" type="button">Post</button>

Here is my jquery code:

  $(document).on("click","#cmntSubmit",function(){
      var cmnt = $("#comment").val();

  $.ajax({
      url: "",
      data: cmnt,
      success: success,
      dataType: dataType
          });

How will I send this comment field with JQuerry to my Laravel Controller and receive the comment field value with $request ?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2CXfAab
via IFTTT

Aucun commentaire:

Enregistrer un commentaire