pleas help me ,this "Nr and Words Sorter Script" wrkg good but the problem is it dosent sort word vertically,only horizontaly what i have to change in the script ? thnks for helping example if we paste in textarea word-nr list vertical benito albano zalo xxx 321 1 23 Code (markup): the script dosent sort , if we paste horizontaly txt : benito albano zalo xxx 321 1 23 Code (markup): etc its work ,the question is what to change to make script wrk in both ways , thnks <script type="text/javascript"> function sortit(a,b){ return(a-b) } function sortvalues(param){ var inputvalues=document.sorter.sorter2.value.split(" ") if (param==0) //if sort alphabetically inputvalues.sort() else //else if sort numerically inputvalues.sort(sortit) document.sorter.sorter2.value='' for (i=0;i<inputvalues.length-1;i++) document.sorter.sorter2.value=document.sorter.sorter2.value+inputvalues[i]+" " document.sorter.sorter2.value+=inputvalues[inputvalues.length-1] } </script> <form name="sorter"> <p> <textarea rows="10" name="sorter2" cols="50" wrap="virtual"></textarea><br> <input type="button" value="Sort alphabetically" onClick="sortvalues(0)"> <input type="button" value="Sort numerically" onClick="sortvalues(1)"> <input type="reset" value="Reset"> </form> Code (markup):
Hello sweetboy1. Try use javascript Regular Expression for line #10, like the following: var inputvalues=document.sorter.sorter2.value.split(/[\n ]/);
Helllo, the script work good but i have 1 more question what i have to modify in this same script ,to replace or remove "@" if text contains "@" soo in results "@" to be remove or replaced with something else.. i try with var inputvalues=document.sorter.sorter2.value.split(/[\n ]/).split("@").join(""); Code (markup): but dosent work. thank you