Empty field validation in javascript | forms

 
  • HOME  • tutorials  • photos   • free grafics design  • maps
     

CATEGORIES
EXCEL TUTORIAL
SQL TUTORIAL
WEB INFORMATION
WINDOWS
JAVASCRIPT SCRIPTS
COMPUTER SECURITY
GRAFIC DESIGN
HTML
PHP
CSS STYLE
ATLAS OF THE WORLD
DEVELOPER
PHOTOSHOP
MAGAZINE
TOP LISTS
LATEST ARTICLES
md5 hash generator - online tools windows, linux, c#, php
remove duplicate lines in html - online javascript
document.getelementbyid().innerhtml javascript - how to set, example
ucwords javascript convert online tool
hex to rgb converter javascript for colors
convert uppercase to lowercase javascript online script
tooltip
Preview Image Pics Before Upload Javascript
Javascript Close Window
Forms
Image Effects
   • Empty Field Validation In Javascript
  JAVASCRIPT SCRIPTS » FORMS » EMPTY FIELD VALIDATION IN JAVASCRIPT
google ads
 


EMPTY FIELD VALIDATION IN JAVASCRIPT - FORMS
 
How to validate empty field in forms using javascripts


Sometimes empty form fields validation is most unpleasant when you use validation in php (although it is much safer). Therefore, for the interaction to be more pleasant for the user but also to save resources ( PHP language uses server resources  and javascript browser for decoding ) will use a simple and efficient validation script in javascript.

Here is the script:

Copy this javascript in <head> section of your page

=================

<script>
function validare(){
if(document.form.mail.value=="")
{
alert("Sory! You can submit empty values for mail input!");
return false;
}}
</script>


=======================


And the used form:

===============

<form action="" method="post" name="form">
<input name="mail" type="text" />
<input name="" type="submit" onClick="return validare()" value="Submit"/>
</form>


===============


EXAMPLE (click submit button to see the javascript in action)







google ads

 

 

 

the latest articles :
• MD5 hash generator Online tools Windows Linux C Php
• Remove duplicates in html lines online javascript
• documentgetElementById()innerHTML javascript set Example
• How to block processes from starting and running in Windows XP
• List of us american presidents with pictures
• Ucwords javascript convert online tool
• Hex to rgb converter javascript for colors online
• Letter-spacing CSS property for html pages
• SQL Inject protection without complicated class php script and tutorial
• How to insert decimal values into a SQL table row

 

 
 
Copyright ©2008- www.himmera.com

top

eXTReMe Tracker