H I O X INDIA
FREE Javascript
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch Portuguese Japanese தமிழ்
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java Script Source
List All
Date & Time
Calendar
Stop Watch script
Slide Show
Ad Display
Animated Image Effects
Image Effect
Mouse Effects
Color Picker Tool
Dynamic Color
Random Generator
Select All
Form Validation
Formatting Forms
Textbox Counter
Dynamic Form select
Bookmark
Window / User Info
Pagination
Security / Authenticate
Status Bar
Title Bar
Cursor Position
Country List
Calculators
Delete Repeated Values
Alphanumeric
Free Games





Javascript inArray


About
 Javascript inArray concept is used to find whether given value is present in an array or not. Enter the value into textbox and find whether the given value is present in array or not.


Features
a) You can verify whether the value entered in the textbox is present in an array.
b) Copy the code from the given textarea and use it.

Preview

Enter value into Textbox to check whether it is present in array.
The array has value from 1 to 10.

Value:

   


Code
Javascript Code
<!-- Script by hscripts.com -->
<script type="text/javascript">
Array.prototype.inArray = function (value)
{
// Returns true if the passed value is found in the
// array. Returns false if it is not.
var i;
for (i=0; i < this.length; i++) 
{
	if (this[i] == value) 
	{
	return true;
	}
}
return false;
};
function cal(xx)
{
	var arr= new Array(1,2,3,4,5,6,7,8,9,10);
	if(arr.inArray(xx))
	{
		alert("Your value is found in the Array");
	}
	else
	{
		alert("Your value is not found in the Array");
	}
}
</script>

<!-- Script by hscripts.com -->

Release Date - 07-01-2008

Get free version without ©copyright link for just 5

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


Usage
 a) Copy the above Javascript code into the <head> tag of your file.
 b) Creating a HTML form using following code.
 <form name=arra onSubmit="cal(arra.val.value)">
 <input type=text name=val size=12 style="border-color:blue;">
 <input type=submit name=cs value="Submit">
 </form>

 c) Here, the function "cal(form.val.value)" is called by passing the entered value in the textbox as argument. Then the function checks whether the argument passed is present in the array or not and returns message accordingly.
 d) Copy the code into your page and use it.


License
- This javascript (misspelled as java script)/HTML code is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- Detailed License information can be found here
- You can purchase the script if your requirements does not meet GPL License terms.


privacy policy     license     sitemap
© 2004-2010 HIOX INDIA

Others