Category: JavaScript

How to calculate total price using keyup function in jquery or javascript

The keyup() method triggers the keyup event, or attaches a function to run when a keyup event occurs. You can use parseFloat and parseInt to get the values from the other inputs, toFixed to ensure the final value looks like currency (remove that if it’s not needed), and provide a fallback of 0 in case […]

Canvas Clock Start javascrpit

Canvas Clock Start

To start the clock, call the drawClock function at intervals: <!DOCTYPE html> <html> <body> <canvas id=”canvas” width=”400″ height=”400″ style=”background-color:#333″> </canvas> <script> var canvas = document.getElementById(“canvas”); var ctx = canvas.getContext(“2d”); var radius = canvas.height / 2; ctx.translate(radius, radius); radius = radius * 0.90 setInterval(drawClock, 1000); function drawClock() { drawFace(ctx, radius); drawNumbers(ctx, radius); drawTime(ctx, radius); } function […]

Onsubmit event using ajax and return true but Form not submit using Jquery

The onsubmit event is commonly used to validate the contents of form controls and set the contents of some input:hidden elements before submitting. If the user forgot to fill some required fields or made some other mistake on the form, you can cancel the submission with the onsubmit event. See the example below for details […]

How to find minimum value in array using JavaScript javascrpit

How to find minimum value in array using JavaScript

I have been using some JavaScript techniques in the past to find the minimum number in an array. I recently stumbled upon a real fast and simple solution to find the min number in an array and thought of sharing it with all of you. Let me know what do you think of this method. […]

Using new Google reCAPTCHA with PHP and AJAX Ajax

Using new Google reCAPTCHA with PHP and AJAX

In the tutorial, I will be using a working HTML contact form. We will submit it via AJAX (the page will not reload) and process the form values with PHP. Google has released the new reCAPTCHA. They need just a single click to confirm they are not a robot. So, reCAPTCHA will protect your website […]

How to send HTML Form array inside array in codeigniter using Ajax

Now, when you simply submit your form the normal way, your browser takes care of sending HTML input arrays inside array with ease and you can begin to segment your data on your server. This was an interesting complication that I ran into while making a form with dynamic related form fields. View Code JavaScript […]