JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Calendar Script Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 




Number Validation Script


About
This javascript will help you to validate the textbox in a form. This java script function helps you to check whether the given value in the textbox is number or integer value.


Features
a)You can validate the textbox with an integer value.
b)You can validate form using this javascript.
c)Just copy the given free javascript code and use it.

Preview
Enter value:


Code
Javascript Code
<!-- Script by hscripts.com -->
/* Created on : Dec 1,2007 Javascript for validating a rounded integer value. This script validates the given input and returns true or false. You have to just call the function with the input as argument. Eg:var d = isInteger(3); returns true; var e = isInteger(4.4); returns false;*/
<script type="text/javascript"> function isInteger(s) { var i; s = s.toString(); for (i = 0; i < s.length; i++) { var c = s.charAt(i); if (isNaN(c)) { alert("Given value is not a number"); return false; } } return true; } </script>
<!-- Script by hscripts.com -->


HTML Code
<!-- Script by hscripts.com -->
<form name=test> <input type=text name=en onKeyup="isInteger(this.value)"> <input type=button name=cc value="Check" > </form>
<!-- Script by hscripts.com -->

Release Date - 01-12-2007.
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
Here we have explained with a form
a)Creating a form by copying the html code to the <body> tag.
<form name=test>
<input type=text name=en onKeyup="isInteger(this.value)">
<input type=button name=cc value="Check">
</form>
b)Copy the javascript code into the <head> tag of your page.
c)If user enters value in the textbox, the function "isInteger(this.value)" is called to check whether the entered value is number. If given value is number, textbox will accept it orelse an alert message will appear.



License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting