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:…
Category: JS
How to get current Date and Time using JavaScript || JavaScript Date Formats
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 …
Top 35 Essential JavaScript Interview Questions and Answers
Here I am sharing top 35 essential javascript interview questions and answers for freshers and experienced. This list of javascript interview questions and answers will be helpful for javaScript beginner who just started their career as javascript developer, and surely help you during interview session. Question #1 – What is JavaScript? JavaScript is a client side scripting language with an inbuilt object-oriented capability that allows developers to build up client side validations with HTML pages. It is object-based, lightweight and cross platform. Question #2 – How to use external JavaScript file in a HTML page? Lets…
How to prevent page from reloading after form submit?
You can prevent the form from submitting with $(“#prospects_form”).submit(function(e) { e.preventDefault(); }); Of course, in the function, you can check for empty fields, and if anything doesn’t look right, e.preventDefault() will stop the submit.
How to calculate your accurate loan EMI ? Check a fully functional EMI calculator
Now a days every finance organization required a EMI calculator for their costumers. There are some EMI calculator available on internet but the issue with them of fully functionality like- Pie graph not working and loan EMI is not calculating on input. So to get rid off these all issue, I developed a fully functional Loan EMI calculator by using HTML5 and jQuery. BUY $80 If anybody want to integrate this calculator in their website, please comment here..
How to open default home page in firefox
his behavior can sometimes be caused by an add-on installed in Firefox. To figure out if this might be the cause, start Firefox in Safe Mode which will cause Firefox to load without any add-ons running. To start Firefox in Safe Mode, hold the Shift key while clicking on the Firefox icon and you will be prompted to start in Safe Mode or Reset Firefox. Choose Safe Mode and see if Firefox loads up the default page you are trying to set. If it does, then one of your add-ons…
Simple CSS-Only Row and Column Highlighting
Highlighting rows of a table is pretty darn easy in CSS.tr:hover { background: yellow; } does well there. But highlighting columns has always been a little trickier, because there is no single HTML element that is parent to table cells in a column. A dash of JavaScript can handle it easily, but Andrew Howe recently emailed me to share a little trick he found on StackOverflow, posted by Matt Walton. It was a few years old, so I thought I’d just clean it up and post it here. The trick is using huge pseudo elements…