O
Omicron
Hello,
I have written the following small "database" program using
Microsoft's Tabular Data Control (TDC) and some Javascript:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SEARCH Experiment</title>
<SCRIPT LANGUAGE="javascript" type="text/javascript">
function justTitle_filter()
{
TDC1.FilterColumn="Title";
TDC1.FilterValue=newTitle.value;
TDC1.FilterCriterion="=";
TDC1.Reset();
}
</SCRIPT>
</head>
<body>
<h1>Microsoft Tabular Data Control (TDC) and Javascript Filtering</h1>
<!-- Show the entire database when page is first loaded or refreshed --<OBJECT ID=TDC1 CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83"
WIDTH=0 HEIGHT=0>
<PARAM NAME=DataURL Value="database.txt">
<PARAM NAME=TextQualifier Value=",">
<PARAM NAME=UseHeader Value=True>
</OBJECT>
<!-- -->
<INPUT TYPE=BUTTON VALUE="Title Search - Enter In Box and Then Click
Here:" ONCLICK=justTitle_filter()>
<INPUT TYPE=TEXT ID=newTitle>
<p>
<table border="1" summary="Database Headings">
<tr>
<td width="112">TITLE</td>
<td width="60">COMP</td>
<td>B</td>
<td width="22">PG</td>
<td width="62">OWNER</td>
<td width="32">YR</td>
</table>
<TABLE ID=Table1 BORDER DATASRC=#TDC1 summary="Database Results">
<TBODY>
<tr>
<td width="112"><div datafld=title></DIV></TD>
<td width="60"><div datafld=composer></DIV></TD>
<td><div datafld=book></DIV></TD>
<td width="22"><div datafld=page></DIV></TD>
<td width="62"><div datafld=owner></DIV></TD>
<td width="32"><div datafld=year></DIV></TD>
</TR>
</TBODY>
</TABLE>
</body>
</html>
And the Database that it reads (which must be named database.txt) is
as follows:
Title,Composer,Book,Page,Owner,Year
Yellow Submarine,Beatles,2,235,Smith,1987
Tour's End,Stan Getz,4,15,Williams,1967
Got To Hurry,Yardbirds,2,435,Moore,1998
Last Dance,Summers,2,158,Rossmann,1987
All works fine.
However, when I use the SEARCH function as I have written it, I must
enter the search string in the same upper/lower case manner that the
database itself is written.
In other words, if I want to search for the sub-string "end", I must
enter it as "End" otherwise the search will yield no hit, because as
you can see from the database, the word 'end' is written with a
capital letter 'E'.
How can my search function be re-written so that it will find an
existing string regardless of whether the database entry was entered
with a capital letter or a lower case letter?
Thank you.
I have written the following small "database" program using
Microsoft's Tabular Data Control (TDC) and some Javascript:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SEARCH Experiment</title>
<SCRIPT LANGUAGE="javascript" type="text/javascript">
function justTitle_filter()
{
TDC1.FilterColumn="Title";
TDC1.FilterValue=newTitle.value;
TDC1.FilterCriterion="=";
TDC1.Reset();
}
</SCRIPT>
</head>
<body>
<h1>Microsoft Tabular Data Control (TDC) and Javascript Filtering</h1>
<!-- Show the entire database when page is first loaded or refreshed --<OBJECT ID=TDC1 CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83"
WIDTH=0 HEIGHT=0>
<PARAM NAME=DataURL Value="database.txt">
<PARAM NAME=TextQualifier Value=",">
<PARAM NAME=UseHeader Value=True>
</OBJECT>
<!-- -->
<INPUT TYPE=BUTTON VALUE="Title Search - Enter In Box and Then Click
Here:" ONCLICK=justTitle_filter()>
<INPUT TYPE=TEXT ID=newTitle>
<p>
<table border="1" summary="Database Headings">
<tr>
<td width="112">TITLE</td>
<td width="60">COMP</td>
<td>B</td>
<td width="22">PG</td>
<td width="62">OWNER</td>
<td width="32">YR</td>
</table>
<TABLE ID=Table1 BORDER DATASRC=#TDC1 summary="Database Results">
<TBODY>
<tr>
<td width="112"><div datafld=title></DIV></TD>
<td width="60"><div datafld=composer></DIV></TD>
<td><div datafld=book></DIV></TD>
<td width="22"><div datafld=page></DIV></TD>
<td width="62"><div datafld=owner></DIV></TD>
<td width="32"><div datafld=year></DIV></TD>
</TR>
</TBODY>
</TABLE>
</body>
</html>
And the Database that it reads (which must be named database.txt) is
as follows:
Title,Composer,Book,Page,Owner,Year
Yellow Submarine,Beatles,2,235,Smith,1987
Tour's End,Stan Getz,4,15,Williams,1967
Got To Hurry,Yardbirds,2,435,Moore,1998
Last Dance,Summers,2,158,Rossmann,1987
All works fine.
However, when I use the SEARCH function as I have written it, I must
enter the search string in the same upper/lower case manner that the
database itself is written.
In other words, if I want to search for the sub-string "end", I must
enter it as "End" otherwise the search will yield no hit, because as
you can see from the database, the word 'end' is written with a
capital letter 'E'.
How can my search function be re-written so that it will find an
existing string regardless of whether the database entry was entered
with a capital letter or a lower case letter?
Thank you.