Category : javascript

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) ..

Read more

I want to create a survey app for my client for this I select surveyjs library to build the app. I have created all tables like Survey, Questions, Answers, and Options now I want to pass dynamics questions and answers from database like public function my_survey($slug) { $surveys = Survey::where(‘slug’,$slug)->first(); $questions = Question::where(‘survey_id’,$surveys->id)->with(‘answers’)->get(); return view(‘user.my-survey’, ..

Read more

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 ..

Read more

I have a cookie created in PHP with the Jquery method where the client enters a value in an input and this cookie is created with that Value while more values are created with a comma. Example Creation cookie in jquerry: <script type="text/javascript"> $(function () { $("#btnAdd").click(function () { if($(‘#addtokendelivery’).val() === ”){ alert(‘Valor en Blanco’); ..

Read more

I’m trying to add dynamically input fields using jquery. So I have the following code My HTML code : <div class="col-12 col-md-12 col-xl-8 col-left"> <div class="card mb-4 "> <div class="card-body "> <button type="button" class="btn btn-outline-primary mb-1 add_new_frm_field_btn">Ajouter un nouveau casting</button> </br> </br> <div class="row"> <div class="col-12"> <div class="card mb-4 form_field_outer "> <div class="card-body form_field_outer_row "> ..

Read more

I have a header and a home page in which I want to use Vue. I have the following setup: app.js: require(‘./bootstrap’); import Vue from ‘vue’; Vue.component(‘search’, require(‘./components/Search’).default); const header = new Vue({ el: ‘#header’ }) home.js: require(‘./bootstrap’); import Vue from ‘vue’; Vue.component(‘search-by-car’, require(‘./components/SearchByCar’).default); const searchByCar = new Vue({ el: ‘#search-by-car’ }) Of course the ..

Read more

I have been trying to make the image submitted through the image form submit to a directory. the directory "mywebsite.com/asset/profile", Please how do I do it. below is the Html code and the Controller code. It’s a laravel Framework. HTML CODE// <div class="custom-file"> <input type="file" class="custom-file-input" id="image" name="image" accept="image/*" required> <label class="custom-file-label" for="image" required>Select photo</label> ..

Read more

The filepaths are definitely correct. My web broswer displays a blank area with the correct height and tag that reads "first slide, seconds slide, third slide" etc… i’ve also tried defining the full filepath like this: C:.png <div id="carouselExampleFade" class="carousel slide carousel-fade" data-ride="carousel" style="height: 32rem;"> <div class="carousel-inner"> <div class="carousel-item active"> <img class="d-block w-100" src="{{ asset(‘viewscomponentsimages.png’) ..

Read more

I have a laravel project where admin can change user data via form. I want this form to be submitted by ajax. But it doesn’t get submited. I have a form: <form id="userData{{$loop->iteration}}" method="POST"> @csrf <!–some inputs–> </form> <button id="changeUserData{{$loop->iteration}}" data-id="#userData{{$loop->iteration}}">Save</button> JS: $("#changeUserData{{$loop->iteration}}").click(function (e) { var ele = $(this); var formId = ele.attr("data-id"); console.log(formId); $(formId).submit(function ..

Read more

Is there a way to call a laravel route (with ID) inside a javascript? Right now I’m getting an encoded results and I’m stuck with this. I appreciate any help!. TY I have this redirect link inside a javascript. return ` <a href = "{{ route(‘smshistory.view’, [‘id’ => $smshistory->id]) }}" class="btn btn-link btn-success btn-just-icon btn-round" ..

Read more