Jump to content

aotearoa

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aotearoa's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am trying to make a little script that allows a user to search for blocks of text within strings. The user enters data into form fields and he or she can enter text into another form field (needle) to search the data fields (haystack). When the search string matches something in the data fields the associated data fields are highlighted in a yellow background color. Right now the search string is acting funny. When I enter a search string I get no highlighting unless if the first character(s) of the search string are the same as the first character(s) for the items. For instance, If I search for the text "at" in the word "bat" I will not get any yellow highlighting. But I would get highlighting for "bat" if I search for "ba." How would I change the code so that any data field is highlighted if the search string exists anywhere in the text for the data field? Also, I figured out how to stop the form fields from being yellow if they and the search field are empty/NULL, but I did this part in another file (as an IF statement) and can't seem to get it to work in the other file. How would I make it do the highlighting if and only if there is a search string in the search field (i. e. only highlighting when the search field is not NULL/empty). The code from my 2 files is here...: http://pastie.org/1095526 , http://pastie.org/1095528 Thanks very much to anyone who can help me.
  2. I am having trouble with a small PHP program. I have to load item and amount data from table cells into an array, and then be able to sort and reverse sort the items in the cells. I also have to track the errors when non-numeric data is entered a s an amount, and total the numeric amounts (These parts I think I have coded correctly.). I am having trouble with the array part. I don't think item values are being loaded into the array. I debugged it as much as I could. My code is here-- http://pastie.org/1084621 . I am completely new to this, having only done little PHP/JavaScript programs like this for some classes in the last few months. Any help would be greatly appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.