Client side form validation usually done with javascript. For the majority of your users, JavaScript form validation will save a lot of time up front. More...
CAPTCHA is a simple test to determine if a user is a computer or a human. It is used to prevent spam abuse on the websites. The goal of this tutorial is to demonstrate how to make your own simple CAPTCHA protection using PHP and AJAX technologies. More...
JavaScript is mainly used as a client side scripting language, while PHP is a server side technology. Unlike Java or ASP.Net, PHP doesn't have tools to make it work client side. That is why you need to combine JavaScript and PHP scripts to develop powerful web-applications. More...
Normally when you have a form with several text input fields, it is undesirable that the form gets submitted when the user hits ENTER in a field. Some people are pressing the enter key instead of the tab key to get to the next field. They often do that by accident or because they are accustomed to terminate field input that way. If a browser regards hitting ENTER in a text input field as a request to submit the form immediately, there is no sure way to prevent that. More...
Arrays can be used in many ways to store and organize data quickly and efficiently. It is one of the more useful data types available to any programming language. This article describes the basics to create and make operations with indexed, associative, and multidimensional arrays. More...
Sometimes when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this. avaScript supports two conditional statements: if...else and switch. In this tutorial we will will show you how to use both of them. More...
Sometimes instead of just adding your javascript to the page and having the browser perform the tasks as soon as the script is read, you might want your javascript to be performed only upon the detection of a certain event. A function is a block of code which can be called from any point in a script after it has been declared. It is basically a compartmentalized JavaScript designed to accomplish a single task. Furthermore, JavaScript written into functions will not be performed until you specifically ask for it. This way you gain complete control of the timing. Functions are useful because they contribute to rapid, reliable, error-reducing coding, and increase legibility by tiding up complicated code sequences. More...
A variable's purpose is to store information so that it can be used later. A variable is a name, or identifier, that represents some data that you set. This article shows the basic idea on how to use variables in JavaScript, along with examples, and descriptions of the examples. More...
JavaScript performs several types of repetitive operations, called "looping". Loops are set of instructions used to repeat the same block of code till a specified condition returns false or true depending on how you need it. This tutorial shows the basic idea on how to use looping statements in JavaScript, along with examples, and descriptions of the examples. More...
Sometimes it is necessary to set the focus to the first available form control. The problem is that complex web pages can contain multiple forms and each form individually can contain hidden or disabled elements and controls that cannot accept focus. In this tutorial we will create a function which iterates through all forms until it finds the first available form control.
More...
Targeting windows allows the document writer to assign names to specific windows, and target certain documents to always appear in the window bearing the matching name. Targeting controls where the new document will be displayed when the user follows a link. Most of the time, clicking on a link simply loads a new document in the same window where the link was. In this tutorial we will show you how to deliver the content you want in a new window, or if you are using frames, in another frame. More...
JavaScript is a simple to comprehend and easy to use scripting language. When used in conjunction with a Web browser's Document Object Model (DOM), it can produce powerful dynamic HTML browser-based applications. In this tutorial we will print the text in a web page as well as the time and date on your computer. More...
JavaScript is a cross-platform, object-oriented scripting language invented in web browsers to make web pages more dynamic and give feedback to your user. Adding JavaScript to your HTML code allows you to change completely the document appearance, from changing text, to changing colors, or changing the options available in a drop-down list, or switching one image with another when you roll your mouse over it and much more. More...
Perhaps, you face a task to show slightly different information to different website visitors. We decided to address this issue by implementing a generic JavaScript solution. More...