Category : jquery

i am trying to used Select2 jQuery for select box <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" /> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script> In Html,I have defined id as select_bands <select id="select_bands" name="band_name"> </select> When i do console.log(data.bands). my data is coming in this way 0: {id: 1, name: "Deep Purple",….} 1: {id: 2, name: "led zeppelin" …} 2: {id: 3, name: ..

Read more

I have Created a Front end Page where user can delete a row from the table. I have added the Confirmation message as: <a rel="tooltip" class="btn btn-danger btn-link" href="{{action(‘[email protected]’,$row[‘shipment_id’])}}" onclick = "if (! confirm(‘Confirm: Press OK to delete the Entry. Shipment ID: {{$row[‘shipment_id’]}}’)) { return false; }"style="color: red;"> <i class="material-icons">close</i></a> Now I want to replace ..

Read more

my code is two step first step i selecting data from datatable second step if i selected data with same group_id should be giving error. but i did not do. please help me. $(document).ready(function () { $(‘#productTable tbody’).on(‘click’, ‘tr’, function () { $(this).toggleClass(‘selected’); $(this).find(‘input[type=”checkbox”]’).prop(‘checked’, $(this).hasClass(‘selected’)); }); }); // goCustomerStep() { var table= $(‘#productTable’).DataTable(); // Valid ..

Read more

i have edit.blade.php (artbook view) and inside list of photos (from multiple upload – tables in relationship artbooks 1 : N photos): <div class="dataTables_wrapper"> <div class="table-responsive"> <table class="table table-striped" id="table"> <thead> … </thead> <tbody id="tablecontents"> @foreach(($artbook->photos) as $photo) @if(!is_null($photo)) <tr class="row1" data-id="{{ $photo->order }}"> <td>{{ $photo->order }}</td> <td><img class="img-responsive" src="/storage/photos/{{ $photo->filename }}" style="width:100%; height:auto;"/></td> <td><a ..

Read more

Where I have to put IF in jQuery to change color? if I comment the logical IF, data shows normally. here is the code $(‘.tbody-reply’).empty(); if(data != ""){ data.forEach(element => { $(‘.tbody-reply’).append( ""+ "<tr>" + "<td>" + element.description + "</td>" + "<td>" + element.created_at + "</td>" + "</tr>"); // if(element.idResponder == ‘TE’) // $(‘#’).css("background-color", "yellow"); ..

Read more

Where I have to put IF in jQuery to change color? if I comment the logical IF, data shows normally. here is the code $(‘.tbody-reply’).empty(); if(data != ""){ data.forEach(element => { $(‘.tbody-reply’).append( ""+ "<tr>" + "<td>" + element.description + "</td>" + "<td>" + element.created_at + "</td>" + "</tr>"); // if(element.idResponder == ‘TE’) // $(‘#’).css("background-color", "yellow"); ..

Read more

I am using simpleMDE/easyMDE editor with laravel as markdown editor and using parsedown package to display the content. and i did copy paste the youtube embed code but in blade file it is displaying the code of iframe directly, In db it stored like below, <iframe width="956" height="538" src="https://www.youtube.com/embed/a3ICNMQW7Ok" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; ..

Read more

I’m using laravel and ajax request. After call back I pulling updated info into my input form <a data-post-table-id="1" data-post-id="55" id="greenButtonForm1" data-post-color="#80c87d" data-post-title="6346" href="javascript:PopUpShowEdit(1)"><i class="fas fa-adjust" style="color:green;" aria-hidden="true"></i></a> But when I writting in console in browser $("#greenButtonForm1").data(); I’m getting this my previous data before updated page postTitle: 6346 postColor: "#ff464a" postId: 55 postTableId: 1 __proto__: ..

Read more

I am trying to pass the ID value from the blade file into ajax so it the data table will be routed and will call the ProductActivities function in ProductController. Here’s my snippet code for show() function in ProductController: public function show($id) { $product = Product::find($id); $data = Product::with([‘user_modify’], ‘id’, $product->user_modified) ->where(‘product_id’, ‘=’, $id)->first(); $category ..

Read more

I am trying to pass the ID value from the blade file into ajax so it the data table will be routed and will call the ProductActivities function in ProductController. Here’s my snippet code for show() function in ProductController: public function show($id) { $product = Product::find($id); $data = Product::with([‘user_modify’], ‘id’, $product->user_modified) ->where(‘product_id’, ‘=’, $id)->first(); $category ..

Read more

I have a problem I have this radio input which has 3 value , other field input appear depend on value of radio input here is radion button <div class="row"> <div class="col-sm-12"> <div class="form-group"> <label> NATIONALITY: </label> <label for="nationality1" class="ml-5"> <input type="radio" id="nationality1"name="nationality" value="1" class="nationality" onclick="clearselect()" @if(old(‘nationality’) == 1 ) checked="checked" @endif> NAT_1</label> <label for="nationality2"><input ..

Read more

I know I can set selected attribute for a select tag with old put filed: <select name="country" id="state" onChange="loadlist(this.value);" > <option value="usa" {{ (old(‘state’) == ‘usa’) ? ‘selected’ : ” }}>USA</option> <option value="grm" {{ (old(‘state’) == ‘grm’) ? ‘selected’ : ” }}>Germany</option> <option value="eng" {{ (old(‘state’) == ‘eng’) ? ‘selected’ : ” }}>England</option> </select> But ..

Read more

Could someone help me with the following code please? I am using javascript to add a dynamic list using dropbox. In the first dropbox it works fine but in the second it only gives one item as shown enter image description here enter image description here <script type="text/javascript"> $(document).ready(function(){ var postURL = "<?php echo url(‘/admin/service/{{$cust_id}}’); ..

Read more

I want to convert a jquery script to javascript ESC 6 with Fetch api. Laravel response error validations RequestCustomer with status 422. Jquery get Error with FAIL $.ajax({ url: url, type: ‘POST’, dataType: ‘json’, data: formData, }) .done(function(xhr) { console.log(xhr); }) .fail(function(error) { let msg = $("#msg"); if (error.status == 422) { msg.html("").removeClass(‘ui warning message’); ..

Read more

[Error image][1] plase see my error page console log [1]: https://i.stack.imgur.com/w8c5X.png all looks good but I can’t find the exact error, My route file route.php Route::get(‘/story/checkSlug’, ‘[email protected]’); In blade file <div class=”form-row”> <div class=”col”> <div class=”form-group”> <label for=”title”><strong>Slug</strong><span class=”text-danger”>*</span></label> <input class=”form-control” type=”text” placeholder=”Auto Generated Slug” name=”slug” id=”slug” value=”{{ old(‘slug’) }}”> </div> @if ($errors->has(‘slug’)) <span class=”text-danger”>{{ ..

Read more

I am trying to submit form data using Ajax, but I am getting the error message. I am unable to find the error. Little heads up- I am using Sweet Alert to display success or error message Here is the Controller Code – class NewUserRegnController extends Controller { public function submitNewRegn(Request $request){ $first_name = $request->first_name; ..

Read more

My json response have be return garbage of data before expected result here is my controller function : public function getState() { // return $states = $this->site->getState(); // var_dump($states); $states = array( ‘name’ => ‘hab’ ); return response()->json(["data" => $states]); } and the response: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"data":{"name":"hab"}} Note: while i var_dump i get expected data: array(1) { ..

Read more

So i’m dynamically loading modal from my controller, with product information. Each product has a calculator to calculate price. The issue is when I open the modal the first time, I can remove the disable class from the calculate button. If i open/close/open it will work for every calculator on the page. products.blade.php foreach product ..

Read more