vinsa
08-13-2003, 01:39 PM
Hello!
First sorry for my English.
This is my dictionary.
But i have problem with the searching.
The searching is not good.
When I type "april" or "APRIL" for keyword
-> there is no search result?
I must type "April" to find info
about "April". Can some help me
to edit the script, so that
the character case to have no matter
and when I type "april" -> Search result:
"here is the acceptation of April"
==================================
Here is the contents of the data file "MyDatabase.txt"
(First are the keywords, Last are the search results).
This is only example:
==================================
First;Last
accept;here is the acceptation of accept
account;here is the acceptation of account
April;here is the acceptation of April
May;here is the acceptation of May
mean;here is the acceptation of mean
means;here is the acceptation of means
meat;here is the acceptation of meat
==================================
Here is the script
==================================
<html>
<head>
<title>My Dictionary</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
</head>
<body>
<!-- Data source object: file parameters -->
<object id="selectlist" width="0" height="0" classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<param name="DataURL" value="MyDatabase.txt">
<param name="FieldDelim" value=";">
<param name="UseHeader" value="true">
</object>
<h2>Searching in my DICTIONARY</h2>
<form name="SearchResults">
Query a key word: <input id="query" value="" /><button onclick="SearchAble()">search</button>
<button onclick="Clear();">Clear</button>
</form>
<script type="text/javascript">
<!--
page="<html><head><title>Search Results</title></head><body bgcolor='white' leftmargin=3 topmargin=3 text='blue'><center><table border=0 cellspacing=0 cellpadding=0 width=100%><font face=Arial size=3>";
function SearchAble() {
if (document.SearchResults.query.value == ""){
win = parent.middle("","secId5874","scrollbars=1");
win.document.write("write something");
win.document.close();
}
else{
SearchTable()
}
}
function SearchTable() {
win = parent.middle("","secId5874","scrollbars=1");
win.document.write(page);
selectlist.recordset.MoveFirst();
for (var i = 1; i <= selectlist.recordset.AbsolutePosition; i++) {
if(selectlist.recordset("first")==document.SearchResults.query.value) {
win.document.write(selectlist.recordset("last")+", ");
win.document.write("</font></table></body></html>");
win.document.close();
}
selectlist.recordset.MoveNext();
}
}
function Clear() {
win = parent.middle("","secId5874","scrollbars=1");
win.document.write(page);
win.document.close();
document.SearchResults.query.value = "";
}
//-->
</script>
<IFRAME name="middle" width="250" height="300" src="nach.html" frameborder=0 style="border-style: inset; border-width: 2px"></IFRAME>
</body>
</html>
First sorry for my English.
This is my dictionary.
But i have problem with the searching.
The searching is not good.
When I type "april" or "APRIL" for keyword
-> there is no search result?
I must type "April" to find info
about "April". Can some help me
to edit the script, so that
the character case to have no matter
and when I type "april" -> Search result:
"here is the acceptation of April"
==================================
Here is the contents of the data file "MyDatabase.txt"
(First are the keywords, Last are the search results).
This is only example:
==================================
First;Last
accept;here is the acceptation of accept
account;here is the acceptation of account
April;here is the acceptation of April
May;here is the acceptation of May
mean;here is the acceptation of mean
means;here is the acceptation of means
meat;here is the acceptation of meat
==================================
Here is the script
==================================
<html>
<head>
<title>My Dictionary</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
</head>
<body>
<!-- Data source object: file parameters -->
<object id="selectlist" width="0" height="0" classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<param name="DataURL" value="MyDatabase.txt">
<param name="FieldDelim" value=";">
<param name="UseHeader" value="true">
</object>
<h2>Searching in my DICTIONARY</h2>
<form name="SearchResults">
Query a key word: <input id="query" value="" /><button onclick="SearchAble()">search</button>
<button onclick="Clear();">Clear</button>
</form>
<script type="text/javascript">
<!--
page="<html><head><title>Search Results</title></head><body bgcolor='white' leftmargin=3 topmargin=3 text='blue'><center><table border=0 cellspacing=0 cellpadding=0 width=100%><font face=Arial size=3>";
function SearchAble() {
if (document.SearchResults.query.value == ""){
win = parent.middle("","secId5874","scrollbars=1");
win.document.write("write something");
win.document.close();
}
else{
SearchTable()
}
}
function SearchTable() {
win = parent.middle("","secId5874","scrollbars=1");
win.document.write(page);
selectlist.recordset.MoveFirst();
for (var i = 1; i <= selectlist.recordset.AbsolutePosition; i++) {
if(selectlist.recordset("first")==document.SearchResults.query.value) {
win.document.write(selectlist.recordset("last")+", ");
win.document.write("</font></table></body></html>");
win.document.close();
}
selectlist.recordset.MoveNext();
}
}
function Clear() {
win = parent.middle("","secId5874","scrollbars=1");
win.document.write(page);
win.document.close();
document.SearchResults.query.value = "";
}
//-->
</script>
<IFRAME name="middle" width="250" height="300" src="nach.html" frameborder=0 style="border-style: inset; border-width: 2px"></IFRAME>
</body>
</html>