Academic Tutorials

English | French | Portugese | German | Italian
Home Advertise Payments Recommended Websites Interview Questions FAQs
News Source Codes E-Books Downloads Jobs Web Hosting

JavaScript Tutorial
JavaScript Introduction
JavaScript How To
JavaScript Where To
JavaScript Variables
JavaScript If...Else Statement
JavaScript Switch Statement
JavaScript Operator
JavaScript Popup-boxes
JavaScript Function
JavaScript For-Loop
JavaScript While-loops
JavaScript Break Loops
JavaScript For..In Statement
JavaScript Event
JavaScript Try-Catch Statement
JavaScript Throw Statement
JavaScript Onerror
JavaScript Spacial Characters
JavaScript Guideline
JavaScript String
JavaScript Date Object
JavaScript Array
JavaScript Boolean Object
JavaScript Math Object
JavaScript HTML DOM Object
JavaScript Browser Detection
JavaScript Cookies
JavaScript Validation
JavaScript Animation
JavaScript Image Maps
JavaScript Timing Event
JavaScript Create Object
JavaScript Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
Apple Script
PL/SQL Tutorial
SQL Server
.NET (dotnet)
.Net Mobile
C# : C Sharp
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Assembly Language
Forth Programming
Lisp Programming
Data Warehousing
CGI Programming
Emacs Tutorial
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Operating System
Software Testing
SAP Module
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Financial Accounting
Managerial Accounting
Network Sites

JavaScript Validation

Previoushome Next

To create a Java Script-enabled form that checks whether a user has filled in the form correctly or not before it's sent to the server. This is called form validation.

What is form validation?

Form validation is the process of checking that a form has been filled in correctly or not before it is processed.

For example, if your form has a box for the user to type their email address or any user id, you might want your form handler to check that they've filled in their address before you deal with the rest of the form.

There are two methods for the form validation.

1: Client-Side validation

2: Server-side validation

1: Client-Side validation

In Java Script Client-side form validation is an important part of a web site where data needs to be collected from the user. Users are innately ignorant, and will mess up data entry in a web form if given the chance. It is the job of the web programmer, then, to make sure his pages which use forms include client-side form validation using JavaScript.

<script type="text/javascript">
function testbox(form)
Ctrl = form.inputbox1;
if (Ctrl.value == "" || Ctrl.value.indexOf ('@', 0) == -1)
return (false);
} else
return (true);

2: Server-side validation

In Java Script the server also benefits from client-side validation since it saves a number of round-trips between the visitor and the server owing to typos and easily spotted mistakes. This advantage does not alleviate the neccessity of doing server-side validation.


<script type="text/javascript">
function validateForm()
var username = document.form1.username.value;
var phone =;
var passA = document.form1.passwordA.value;
var passB = document.form1.passwordB.value;
alert("Username required");
return false;
alert("Phone must be numerical");
return false;
if(!bothSame(passA, passB))
alert("Passwords must match");
return false;
return true;

function validateRequired(username)
if(username==null || username=="")
return false;
return true;

function isValid(phone)
var i;
var allowed="0123456789";
return false;
return true;

function bothSame(passA, passB)
return true;
return false;

<form name="form1" action="SumitPage.html" onSubmit="return
validateForm()" method="post">
Username: <input type="text" name="username" size="25">
Password: <input type="text" name="passwordA" size="25">
retype Password: <input type="text" name="passwordB" size="25">
Phone: <input type="text" name="phone" size="25">
<input type="submit" value="Submit">

Web browsers can disable Java Script, so it is not a good idea to base your sites security or validation entirely on Java Script.

Be the first one to comment on this page.

  JavaScript Tutorial eBooks

No eBooks on JavaScript could be found as of now.

 JavaScript Tutorial FAQs
More Links » »
 JavaScript Tutorial Interview Questions
The Burrows-Wheeler Transformation As you have seen during your initial in-practical assessment compression algorithms such as run-length encoding perform best when there are long sequences of identical characters. Is it possible to transform our sequence in such a way as to possibly increase the number of successive identical characters in a reversible manner? We will look at one such transformation which is employed in real-world compression algorithms such as bzip2. In this practical assignment you will only be required to perform the forward transformation. Feel free to consult the wikipedia entry on the transformation (included in additional files) You must create a C++ program as follows ? It must take as command line argument input a single string composed of upper case alphabetic characters and must prepend the character '^' and append '|' which represent the start and end position markers respectively. ? All possible rotations of the string must be calculated, stored in an appropriate data structure and output to the screen. e.g. If the input is '^TOMORROW|' (^ and | are the added start and end characters) The rotations will be ^TOMORROW| |^TOMORROW W|^TOMORRO OW|^TOMORR ROW|^TOMOR RROW|^TOMO ORROW|^TOM MORROW|^TO OMORROW|^T TOMORROW|^ ? These variations will need to be sorted according to their first character and output to the screen. You have been provided with a library BWTSort in order to accomplish the sorting. We will analyse sorting in more detail later on in the course. Do not submit the library to EVE as this will cause your practical to be flagged as a copy. e.g. MORROW|^TO OW|^TOMORR ORROW|^TOM OMORROW|^T ROW|^TOMOR RROW|^TOMO TOMORROW|^ W|^TOMORRO ^TOMORROW| |^TOMORROW ? The final coloumn of the
I'm using OpenGL in C++, and dealing with ilumination. I'd like my small car game to have two modes, one day-mode and another night-mode, that people would select from the menu. Basically the difference between the two modes will be the color of the source light. I've already written the piece of code that does it. First I'm not sure where to paste it in the program. I've put it in mycamera.cpp, that will follow, and I can't see my route anymore, it's all grey and strange... Anyone knows why? And what am I doing wrong? #include "MyCamera.h" #include "Car.h" namespace proj{ MyCamera::MyCamera() : Entity("MyCamera"){ } MyCamera::~MyCamera(){ } void MyCamera::init(){ cg::tWindow win = cg::Manager::instance()->getApp()->getWindow(); _winWidth = win.width; _winHeight = win.height; } void MyCamera::draw(){ Car *_car; _car = (Car*)cg::Registry::instance()->get("Car2"); glMatrixMode(GL_PROJECTION); glLoadIdentity(); _position = _car->getPosition(); gluPerspective( 45, _winWidth/_winHeight ,1,1500); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(_position[0],_position[1]-500, 400, _position[0],_position[1], 0, 0, 1,0); // init glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); // pre-definições GLfloat position[4] = { 1.0, 1.0, 1.0, 0.0}; /*o zero final indica que trato duma luz direccional. as coordenadas anteriores são os vectores direcção dos raios*/ GLfloat ambientLight[4] = { 1.0, 1.0, 0, 1.0}; GLfloat diffuseLight[4] = { 1.0, 1.0, 0, 1.0 }; GLfloat specularLight[4] = { 1.0, 1.0, 0, 1.0}; glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);//local viewpoint // atribui-las a fonte glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight); glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight); glLightfv(GL_LIGHT0, GL_SPECULAR, specularLight); glLightfv(GL_LIGHT0, GL_POSITION, position); } void MyCamera::onReshape(int width, int height){ _winWidth = width; _winHeight = height; } }
More Links » »
 JavaScript Tutorial Articles
More Links » »
 JavaScript Tutorial News
More Links » »
 JavaScript Tutorial Jobs
More Links » »

Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previoushome Next

Keywords: javascript date validation, form validation, javascript validation user, validation routine

HTML Quizzes
CSS Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
XML Quizzes
XML Quiz
XSL Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizzes
JavaScript Quiz
VBScript Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizzes
ASP Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizzes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
VC++ Quiz
Multimedia Quizzes
SVG Quiz
Flash Quiz
Media Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building Quizzes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizzes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
Programming Langauges Quizzes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizzes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizzes
Oracle Quiz
MySQL Quiz
Operating System Quizzes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
Software Testing Quizzes
Testing Quiz
Firewalls Quiz
SAP Module Quizzes
ERP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizzes
Corba Quiz
Networking Quiz
Microsoft Office Quizzes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizzes
Financial Accounting Quiz
Managerial Accounting Quiz
Testimonials | Contact Us | Link to Us | Site Map
Copyright © 2008. Academic All rights reserved Privacy Policies | About Us
Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Webhosting in India | Dedicated Server in India | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World
Copyright © 2003-2015 Vyom Technosoft Pvt. Ltd., All Rights Reserved.