mattinahat Posted July 28, 2010 Share Posted July 28, 2010 Hey Everybody, I was hoping someone could help me out as I'm fairly new to Json and javascript in general. I've combed through all the tutorials and sample scripts I could find, but alas! I seem to always stumble to a dead end. Onto my question: I'm trying to create a javascript enabled searchbar that can display data based on a multidimensional json array. Essentially, I have this view that goes like: First | Last | State ----------------------- John | Doe | MA Alex | Baker | OH Jeff | Ree | MN and I need to search "john" and then throw "doe" in the same search box. Is this even possible? Can someone help me out/point me in the right direction? Thanks so much!! -Matt Quote Link to comment https://forums.phpfreaks.com/topic/209151-search-json-with-javascript/ Share on other sites More sharing options...
trq Posted July 29, 2010 Share Posted July 29, 2010 What does you json look like? Quote Link to comment https://forums.phpfreaks.com/topic/209151-search-json-with-javascript/#findComment-1092464 Share on other sites More sharing options...
mattinahat Posted July 29, 2010 Author Share Posted July 29, 2010 That would probably be helpful saveJson({ "groups": [ { "group_id": "0", "group_name": "Academic/Admin", "group_color": "00ff00" }, { "group_id": "4", "group_name": "Restaurants", "group_color": "0000ff" }, { "group_id": "2", "group_name": "Residential", "group_color": "ff0000" }, { "group_id": "6", "group_name": "Parking Lots", "group_color": "00ffff" }, { "group_id": "3", "group_name": "Commons", "group_color": "ff8000" }, { "group_id": "5", "group_name": "Other", "group_color": "ff00ff" } ] , "subgroups": [ { "subgroup_id": "0", "group_id": "2", "subgroup_name": "NS", "lat": "", "lon": "" }, { "subgroup_id": "1", "group_id": "5", "subgroup_name": "sd", "lat": "", "lon": "" }, { "subgroup_id": "2", "group_id": "6", "subgroup_name": "fef", "lat": "", "lon": "" } ] }); and so on, this is just a snippet; there are more text based items further along, and I need to search each part of group and subgroup in one box. Thanks for all your help in advanced! -Matt Quote Link to comment https://forums.phpfreaks.com/topic/209151-search-json-with-javascript/#findComment-1092561 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.