Search function - upper and lower letters

Discussion in 'Javascript' started by Omicron, Jan 17, 2008.

  1. Omicron

    Omicron Guest

    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.
     
    Omicron, Jan 17, 2008
    #1
    1. Advertising

  2. Omicron schreef:
    > 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?
    >


    According to the msdn website, all you need to do is add the following:

    TDC1.CaseSensitive = false;

    http://msdn2.microsoft.com/en-us/library/ms531360(VS.85).aspx


    JW
     
    Janwillem Borleffs, Jan 18, 2008
    #2
    1. Advertising

  3. Omicron

    Omicron Guest

    On Jan 18, 5:32 am, Janwillem Borleffs <> wrote:
    > Omicronschreef:
    >
    > > 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?

    >
    > According to the msdn website, all you need to do is add the following:
    >
    > TDC1.CaseSensitive = false;
    >
    > http://msdn2.microsoft.com/en-us/library/ms531360(VS.85).aspx
    >
    > JW


    Thank you once again for the help on that question. Perhaps you assist
    me once agin (if I may be so bold).
    I'm trying to figure out how I could get the TOTAL NUMBER OF RECORDS
    that are in Text file I create for the TDC to read? In other words,
    I'd like to be able to denote, on the webpage that after the database
    was displayed, that it contained 457 records (or whatever). As you
    know, the text file used by the TDC is a CSV list. Each time I type a
    new line of CSV data, I consider it a new record. Is there a way to
    get a variable for the total number of records that I could bring to
    the screen via HTML or ???
    Thank you once again for your time and knowledge.
    Oh, yes...I have been plowing through the Microsoft site at
    http://msdn2.microsoft.com/en-us/library/
    but haven't found what I think I'm looking for!
     
    Omicron, Feb 10, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    733
    J├╝rgen Exner
    Dec 7, 2004
  2. ANM
    Replies:
    2
    Views:
    1,457
    Thomas Schodt
    Mar 7, 2004
  3. Rhiner Dan
    Replies:
    1
    Views:
    774
    Mike Wahler
    Mar 27, 2005
  4. timm
    Replies:
    1
    Views:
    168
  5. BlackHelicopter
    Replies:
    0
    Views:
    620
    BlackHelicopter
    Jan 31, 2013
Loading...

Share This Page