Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <form>
  2. <button class="btn btn-success mr-2" id="done">Mark As Done<i class="ml-2 fas fa-check"></i></button>
  3. <input type="hidden" name="done" value="done">
  4. <button class="btn btn-warning">Mark as in progress<i class="ml-2 fas fa-hourglass-half"></i></button>
  5. <input type="hidden" name="done" value="d">
  6. </form>
  7.  
  8. $("button").click(function(e) {
  9. console.log('clicked');
  10. e.preventDefault();
  11. var input = $("input[name=done]").val();
  12. console.log(input);
  13.  
  14.  
  15.  
  16. $.ajax({
  17. url : '/setstatus',
  18. method : 'post',
  19. data : {
  20. value : input,
  21. },
  22. headers:
  23. {
  24. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  25. },
  26. success : function(response){
  27. console.log('success');
  28. }
  29. });
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement