Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form>
- <button class="btn btn-success mr-2" id="done">Mark As Done<i class="ml-2 fas fa-check"></i></button>
- <input type="hidden" name="done" value="done">
- <button class="btn btn-warning">Mark as in progress<i class="ml-2 fas fa-hourglass-half"></i></button>
- <input type="hidden" name="done" value="d">
- </form>
- $("button").click(function(e) {
- console.log('clicked');
- e.preventDefault();
- var input = $("input[name=done]").val();
- console.log(input);
- $.ajax({
- url : '/setstatus',
- method : 'post',
- data : {
- value : input,
- },
- headers:
- {
- 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
- },
- success : function(response){
- console.log('success');
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement