Kmspico Download | Official KMS Activator Website [New Version 2024] Fast and Easy Converter YouTube to MP3 Online KMSAuto Net Activator Download 2024 Immediate Byte Pro Neoprofit AI Blacksprut without borders. Discover new shopping opportunities here where each link is an entrance to a world ruled by anonymity and freedom.

Insert (Create) Operation Laravel without refresh page Using Jquery OR Javascript

Through this tutorial we will tell you today that how to save the data into database with refreshing page.

So let us explain step by step today.

1. First of all, make a blade file in which you add the code of the html below.


<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>CURD Operation laravel without refresh page Using Jquery OR Javascript.</title>
<link rel="stylesheet" href="">
<!-- font awesome-->
<link rel="stylesheet" href="">
<link href="" rel="stylesheet">
<!-- bx-slider--> 
<link rel="stylesheet" href="">
<!-- google font-->
<link href="" rel="stylesheet">
<div class="s-f-mid-sec">
<div class="container">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
<div class="s-f-inner-sec">
<div class="s-f-form-sec">
<form id="myform">
<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
<div class="form-group">
<label>1. First Name <span>*</span></label>
<input type="text" class="form-control" name="firstname" placeholder="Enter full first name of the applicant/ student">
<!-- form-group-->
<div class="form-group">
<label>2. Last Name <span>*</span></label>
<input type="text" name="secondname" class="form-control" placeholder="Enter surname of the applicant/ student">
<div class="form-group">
<label>3. Nationality <span>*</span></label>
<select class="form-control" name="nationality">
<option value="indian">Indian</option>
<!-- form-group-->
<div class="form-group">
<label>4. Address <span>*</span></label>
<textarea class="form-control" name="address" placeholder="Enter Your address"></textarea>
<button id="btn-moreqq" class="submit_btnqq class="btn">SUBMIT</button>
<p id="display_info"></p>

2.After that, add the script code below to the blade file itself.

<script src=""></script>
$(document).ready(function() {
var _token      = $("input[name='_token']").val();
var firstname   = $("input[name='firstname']").val();
var secondname  = $("input[name='secondname']").val();
var nationality = $("select[name='nationality']").val();
var address     = $("textarea[name='address']").val();
if (firstname == "") {
alert('First Name is Required');
} else if (secondname == "") {
alert('Last Name is Required');
} else if (nationality == "") {
alert('Nationality is Required');
} else if (address == "") {
alert('Address is Required');
} else {
url: "",
data: {_token:_token, firstname:firstname, secondname:secondname, nationality:nationality, address:address},
success: function(data) {
$('#display_info').html('Successfully Scholarship Form is Submitted.');

3.Then add the following url code to your web.php file.


Route::post('savedata', 'insertcontroller@savedata');

4.And then after you create a file of a controller, add the code below.


namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use DB;
use Redirect;
use View;
use File;
class insertcontroller extends Controller
public function savedata(Request $request)
$firstname    = $request->firstname; 
$secondname   = $request->secondname;
$nationality  = $request->nationality;
$address      = $request->address;
'firstname'   => $firstname,
'secondname'  => $secondname,
'nationality' => $nationality,
'address'     => $address