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
 




Delete repeated values and get sorted list of values


About
The free javascript function can be used to get sorted list after deleting repeated value of string or integers.


Features
a)Give any repeated values in the textarea as string or integer.
b)Just click the Remove Duplicates button.
c)You can have sorted list of strings or numbers without repeated values.
d)Click reset and check it again with any duplicate values.

Preview
Deleting Duplicate values in an array:



Code
<!--        Script by hscripts.com          -->
<!--        copyright of HIOX INDIA         -->
<!-- Free javascripts @ http://www.hscripts.com -->
<script type="text/javascript">
function delrepeat(mytextarea)
{
   var temp=document.txtchk.mytextarea.value;
   var array2 = temp.split(" ") ;
   var array1= new Array;
   for(var i = 0; i < array2.length; i++) 
   {
       var xx = true;
       var ArrayVal = array2[i];
       for(var j = i+1; j < array2.length; j++)
       {
         if(array2[j] == ArrayVal) 
          xx = false;
       }
       
	if(xx == true)
            array1.push(ArrayVal)
   }
 document.txtchk.mytextarea.value=array1;
}
</script>
<!-- Script by hscripts.com -->

Release Date - 20.6.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
a)Now just copy the above free JavaScript code in your web page inside the head tag.
b)Create a form with name "txtchk" and place a textbox & call it by name "mytextarea"
Ex:-
<form name ="txtchk">
<input type="text" name="mytextarea" size="30" value="1 2 2 3 3 4 4 5 5 5"></form>
c)Create a button with name and call the function delrepeat(mytextarea)by using onclick event.
Ex-
<input type="button" value="Remove Duplicates" onclick="delrepeat(mytextarea)" >
d) Both the button and text area should be in the same form.



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