JSFiddle - React, Tailwind, and code Playground

by gugumetal

JavaScript

$.ajax({
  /* the route pointing to the post function */
  url: '{{url(' / cash / set_result / ')}}' + '/' + contest,
  type: 'POST',
  /* send the csrf-token and the input to the controller */
  data: {
    _token: '{{ csrf_token() }}',
    numberOne: $("#numberOne").val(),
    numberTwo: $("#numberTwo").val(),
    numberThree: $("#numberThree").val(),
    numberFour: $("#numberFour").val(),
    numberFive: $("#numberFive").val(),
    numberSix: $("#numberSix").val(),
  },
  // dataType: 'JSON',
  /* remind that 'data' is the response of the AjaxController */
  success: function(data) {
    alert('Enviado');
  }
});