Unsure How To Structure This Search
I'm trying to make an app that will allow me to input information from a card, then allow me to search the results based on multiple criteria.
This is what I have so far:
Card_Input Form
Name: <value>
Type: <value>
Cost: <value>
Card_Search Form
Search By Name: <value>
Search By Type: <value>
Search By Cost: <value>
I've got an HTML view that displays the results. Right now, I have it working for one variable, but I'm unsure how to take it further. I'd like to be able to search for one or all of those values, and get results for cards that contain ALL of the search criteria at the top of the page and cards, cards that contain TWO of the criteria next, and cards that contain at least ONE of the entered criteria at the bottom. I can't seem to create multiple tables in one view to do this?
I could also use a bit of help with my display statements. Right now I have this: (ss is my search string)
for each r in Card_Input
{
if (ss.contains(r.Card_Type))
{
CardName = r.Card_Name;
CardType = r.Card_Type;
CardCost = r.Card_Cost;
}
}
I'm unsure how to check which criteria are being searched in order to use an && statement - should I pass name type and cost, as well as their inputs, in my search string and pull it from there? Is there an easier way to do this?
I'm hoping this will be my last question for a while = ) Any help would be greatly appreciated, and you have have been awesome so far!