How to Create a Scroll To Top With Some Delay Using JavaScript ?

JavaScript scroll to top tutorial image

Here I am sharing the code for scrolling a page from bottom to top with some delay. You can also use that to reach or show first error element box in your specified form.  Show First Scrolled Error Element Box on Submit :- you can use below jQuery code to scroll on the first error element box on submit – $(‘html, body’).animate({ scrollTop: $(validator.errorList[0].element).offset().top-300 }, 2000); Above code will work for the form group on submit. for an example below – $(“#submit”).on(‘click’, function () { var validator = $(“#form”).validate({ rules:…

How To Get Current Route Name Path in Laravel 5.4 ?

Laravel route name tutorial image

Here I am going to share you problem that most of the laravel beginner found when developed a project with laravel. You can get to know about the solution for the issue ‘get current route name path in laravel 5.4’ with this article. Get Current Route Name Path From view (blade template) – You can get the current route name path from view (blade template) by using below code – {{ url()->current() }} // It will return route name with url {{ Request::path() }} // It will return only route…

How to get current Date and Time using JavaScript || JavaScript Date Formats

JavaScript date time formats image

This tutorial shows, how can you get the current date and time in JavaScript. Use the following JavaScript code to get current date and time with Y-m-dand H:i:s format. JavaScript Date object help us to work with date type of strings. Use new Date() to create a new object with current date and time. var today = new Date(); You can get current date from Date object in Y-m-d format. var date = today.getFullYear()+’-‘+(today.getMonth()+1)+’-‘+today.getDate(); You can get current time from Date object in H:i:s format. var time = today.getHours() + “:” + today.getMinutes() + “:” + today.getSeconds(); You can …