#### Category : ajax

As the title says, I am getting an error when I try to delete my data using laravel/ajax and the function inside the controller: Controller: public function destroy($category_id) {$category_delete = HmsBbrCategory::find($category_id);$category_delete->delete(); return response()->json([ ‘status’=>200, ‘message’=>’Category Deleted!’, ]); } Form & Ajax: delete_category is the id that opens the delete modal and delete_category_btn is ..

I am using yajra datable to fetch all the data from database dynamically using ajax and jquery. I have columns called "Membersid","Role" and so on…now What I want to do is for each value in "Membersid" there should a link which should redirect to details page of that particular membersid. Here is my route: Route::resource(‘/Memberdetails’, ..

my console shows this error whenever I try to update my form using my ajax code: PUT http://127.0.0.1:8000/clinical/bbr-category-configuration-update/1 500 (Internal Server Error) Route: Route::put(‘/bbr-category-configuration-update/{category_id}’, [BBRCategoryConfigurationController::class,’update’]); Ajax: $(document).on(‘click’, ‘.update_category’, function (e){ e.preventDefault(); var cat_id =$(‘#edit_cat_id’).val(); var update_data = { ‘category_name’ : $(‘#edit_category_name’).val(), ‘category_description’ :$(‘#edit_category_description’).val(), } //token taken from laravel documentation $.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: .. Read more I’m trying to send value from form to controller but the error that faced me all forms send value as a first form id I want each form to send the data inside it when I press the send button, but what happens is that everyone sends its content based on the first ID of .. Read more I have a project that with every link clicked, the history.pushState gets activated and an address is being updated accordingly. I then have an ajax function that only loads partial page. When the partial page is loaded, I then click on the item and the page gets redirected. However, when I click the back button, .. Read more I have a project that with every link clicked, the history.pushState gets activated and an address is being updated accordingly. I then have an ajax function that only loads partial page. When the partial page is loaded, I then click on the item and the page gets redirected. However, when I click the back button, .. Read more I am new to Laravel and ajax and I am trying to apply Custom filters on Table data. I have followed this tutorial https://www.youtube.com/watch?v=XmUH049dk9I but unfortunately it’s not working. I have used yajra data tables. Here is my controller code. <?php namespace AppHttpControllers; use IlluminateHttpRequest; use DB; class CustomSearchController extends Controller { function index(Request$request) ..

I’m beginner in jQuery/Ajax. I’m trying to insert data to database with Ajax. I can insert data whatever I want without reload page but when I look at the data with ‘console.log’ I added, I see the id of the first data in the table. Where is my fault? My blade is: <a href="javascript:void(0)" type="button" ..

I want to validate the form with AJAX, because when the normal validation fails, the uploaded files are gone. I get a JSON response but at the working URL: /properties, instead of the form properties/create. This is an example of the response: {"error":{"title":["The title must be at least 10 max:50 characters."],"asking_price":["The asking price must be ..

Demonstration on how my catagory_id is being read (console.log each time I press the edit button) $(document).on(‘click’,’.edit_category’,function (e) { e.preventDefault(); var cat_id =$(this).val(); console.log(cat_id); }); My problem is when I try to output the an array shown at the consoles by clicking the edit button (testing purposes) Not sure how I still get the ..

is there any way where i can make the route so that no use can navigate nor can use that route and only the app can send request to that route for example using ajax. Is there any way? Sourc..

I’m new to Jquery. I’m building a project with Laravel 7.28. I want users to crop an image before upload. I’ve searched on the net but all examples upload the image right after cropping. But I want the user to crop but not upload. I want users to upload the cropped image with input fields. ..

When the user province is selected automatically, the districts not listed, but if I select it manually, the districts is listed. I have 4 tables 1- User table 2- Province table 3- District table 4- learning table I want the user’s province to be automatically listed when the user logs in. If the user province_id ..

I am trying to output an if condition on my two columns in my laravel ajax: $.each(response.all_categories, function (key, item) {$(‘tbody’).append(‘<tr> <td><p class="font-weight-bold mb-0">’+item.category_name+'</p>’+item.category_description+'</td> <td>View: if (‘+item.config_view_type+’ == ‘P’){ <mark class="mark-orange">Public</mark> } elseif (‘+item.config_view_type+’ == ‘R’){ <mark class="mark-orange">Restricted</mark>} <br>Edit: </td> <td>View: </td> <td> <button type="button" value="’+item.category_id+’" class="btn btn-outline-secondary"> <i class="fas fa-edit"></i> Edit</button><button type="button" value="’+item.category_id+’" ..

I am trying to call my table contents using ajax append from a laravel controller function. I am getting this error though Ajax: function fetchcategory() { $.ajax({ type: "GET", url: "/clinical/bbr-category-configuration-data", dataType: "json", success: function (response){ // console.log(response.all_categories);$.each(response.all_categories, function (key, item) { $(‘tbody’).append(‘<tr> <td>’+item.category_name+'</td> <td>’+item.category_name+'</td> <td>’+item.category_name+'</td> <td>’+item.category_name+'</td> </tr>’); }); } }); } Controller: (tabled .. Read more I have the following HTML : <div class="row"> <div class="col-12"> <div class="card mb-4"> <div class="card-body"> <h5 class="mb-4">Projet</h5> <form id="projetform" method="post" action="ajout_projet" class="myForms" enctype="multipart/form-data"> {{ csrf_field() }} <input type="hidden" id="id_hidden" name="id_projet" /> <div class="form-group"> <label for="inputAddress">Numéro de projet</label> <input type="text" class="form-control" id="numero_projet" name="numero_projet" placeholder="Description"> </div> <div class="form-row"> <div class="form-group col-md-6"> <label for="inputState">Client</label> <select id="id_client" class="form-control" name="id_client"> .. Read more I am trying to make a simple data filter in Laravel using jQuery AJAX. In my blade I am doing something like this. ***********collegelist.blade.php************ @foreach($results as $result) showing$result values @endforeach Ajax code $(‘.filter_type :checkbox’).on(‘change’,function() { if($(this).is(‘:checked’)){ var college_type=$(this).val(); alert(college_type);$.ajax({ url:’/collegeListing/public/collegeList/{college_type}/{city}’, type:’get’, data:{college_type:college_type,city:’All Cities’}, success(data){ return data; }, }); } }); And my controller ..

I’m trying to do a real-time search bar for my products list but I keep getting in my consol Uncaught ReferenceError: data is not defined at HTMLInputElement.<anonymous> (produits:243) at HTMLDocument.dispatch (jquery-2.2.4.min.js:3) at HTMLDocument.r.handle (jquery-2.2.4.min.js:3) I want to display the products without refreshing the page that’s why I used ajax, but since I only used it ..

I created a script that adds dynamically input fields or rows. In the rows added dynamically, I have a selected box. So I created another script that when I select an item from the selected bow, a new bloc HTML displays. And I want to display in this bloc displayed , the picture of the ..

I created a script that dynamically adds input fields or rows. In the rows added dynamically, I have a selected box. So I created another script that when I select an item from the selected bow, a new block HTML displays. And I want to display in this bloc displayed, the picture of the selected ..

I managed to dynamically add input fields using this code : My HTML : <div class="row"> <div class="col-12"> <div class="card mb-4 form_field_outer "> <div class="card-body form_field_outer_row "> <form> <div class="form-row"> <div class="form-group col-md-4"> <label for="inputState">Casting</label> <select id="id_casting" class="form-control" name="id_casting"> <option selected>Choose…</option> @foreach($castings as$casting) <option data-id="{{$casting->id_casting}}" value="{{$casting->id_casting}}">{{$casting->nom.’ ‘.$casting->prenom}}</option> @endforeach </select> </div> <div class="form-group col-md-4"> <label ..

I’m trying to pass a variable from Controller to blade view. So there is my Controller : public function index_ajout_projet() { $clients = Client::whereIn(‘id_filiale’,[0, Auth::user()->id_filiale])->get();$agences_conseil = AgenceConseil::all(); $agences_casting = Agence_Casting::all(); return view(‘Projet.ajout_projet’, [ ‘clients’ =>$clients ],[ ‘agences_conseil’ => $agences_conseil ],[‘agences_casting’=>$agences_casting]); } There is my view : <div class="form-row"> <div class="form-group col-md-6"> <label for="inputState">Agence ..