Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback on: irt.org FAQ Knowledge Base Q584, Wednesday October 03, 2007 at 01:07:50

You are here: irt.org | About | Feedback | 5075 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q584

Sent by
single on Wednesday October 03, 2007 at 01:07:50

Worth:

Length:

Technical:

Comments:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 7</title>
</head>

<script language="javascript">

</script>
<body>
<form name="contactForm" onSubmit="doSearch();return false">
<textarea name="tata" cols="76" rows="10">
dfd ,dfd ,fdfd ,dfdf ,dfdddfd
dfd ,dfd ,fdfd ,dfdf ,dfdddfd
dfd ,dfd ,fdfd ,dfdf ,dfdddfd
dfd ,dfd ,fdfd ,dfdf ,dfdddfd
dfd ,dfd ,fdfd ,dfdf ,dfdddfd
dfd ,dfd ,fdfd ,dfdf ,dfdddfd
dfd ,dfd ,fdfd ,dfdf ,dfdddfd
</textarea>
<br>
<select name="item" onChange="contacts=doFormt(this);doSort()">
<option selected>kk</option>
<option>kk</option>
<option>tt</option>
<option>kktt</option>
<option>kktt</option>
</select>
<input type="button" onClick="doSort()" value="Sort">
<input type="button" onClick="doReverse()" value="Reverse">
<input type="text" name="search">-
<input type="button" onClick="doSearch()" value="Search">
</form>
<script language="javascript">
function replace(string,text,by){
var strLength=string.lenth;
var txtLength=text.length;

if ((strLength==0)||(txtLength==0))
return string;
var i=string.indexOf(text);
if(i==-1)
return string;
var newstr =string.substring(0,i)+by;

newstr+=replace(string.substring(i+txtLength,strLength),text,by);
return newstr;
}

var search='';
var item;
var rawdata=replace(document.contactForm.data.value,',','\t');

document.contactForm.data.value=rawdata;

var contact=rawdata.split('\r\n');

function doFormat(what){

item=what.selectIndex;

var output='';
var contact=rawdata.split('\r\n');
for(var i=0; i<contacts.length; i++)
{

if(contacts[i].length!=0)
{

var splitString=contacts[i].split('\t')

output+=splitString[item];

for(var j=0;j<splitString.length;j++)
{

if (j!=item)

output+=бо\t'+splitString[j];
}
output+='\t\n';
}
}
return output.split('\r\n').sort();
function redisplay(){
var output='';
for(var i=0;i<contacts.length;i++){
if(contacts[i].tolowerase90.indexOf(search)>-1)
output+=contact[i]+'\r\n';
}
document.contactForm.data.value=output;
}
function doSort(){
contact.sort();
redispay();
}
function doReverse(){
contact.reverse();
redispay();
}
function doSearch(){
search= document.contactForm.search.value.toLowerCase();
redispay();
}
function doReset(){
document.contactForm.search.value='';
document.contactForm.item.selectedIndex=0;
search='';
contact=rawdata.split('\t\n');
redispay();
}












</script>




</body>

</html>















©2018 Martin Webb