lockedgroove Posted January 31, 2013 Report Share Posted January 31, 2013 I have a page set up where a user can create an account and check checkboxes on what they specialize in (let's say Product 1, Product 2, and so on and they check Product 1 and Product 3). Now I have other accounts that are searching for people dealing in Product X and they post listings so people who specialize in Product X can search and send offers to the people searching for Product X. Is there any way that I can filter a search by what was selected during this account creation? It could be I went at this the wrong way, maybe having the account be able to specialize in X amount and have those be drop down boxes then use Root Level Security, but I'm still restricted to only one field being used. Any advice/input is much appreciated. Thank you for your time. Quote Link to comment Share on other sites More sharing options...
lockedgroove Posted February 1, 2013 Author Report Share Posted February 1, 2013 I've been looking into my issue deeper and I think I may need to create a view (after reviewing this how-to http://howto.caspio.com/views/creating- ... table.html), but I'm not sure how to translate information from a dropdown and compare it to a checkbox. I'm thinking of having a dropdown with Product X and whichever one they chose, a true/false field would be given the appropriate value (convoluted, but with the software limitations this is what I have thought of so far). Would it be possible using Caspio's backend or possibly with Javascript? Such as (pseudo-code): .onsubmit var cb = new String("cb_") var getProduct = new String(document.GetElementByID('dropdownbox').value) var cbCheckProduct = cb + getProduct document.GetElementById(cbCheckProduct).checked What this would do is when the submit button is clicked, check what product in the dropdown box was selected, get the string from it, combine both strings to make the proper name for the entry in the database and check it. This would allow me to compare true/false entries in the database with a view possibly. Would this possibly work, or am I going at this the completely wrong way? Quote Link to comment Share on other sites More sharing options...
lockedgroove Posted February 1, 2013 Author Report Share Posted February 1, 2013 I think I've figured it out for the most part. I'll write down what I did in case anybody has a situation similar to what was described in this post. I set up a relationship between the two tables using an Inner Join (in this example I'll use tbl_Buyer and tbl_List, and in tbl_Buyer there is a sellProduct and in tbl_List there is wantProduct, they will be joined using an Inner Join). After joining, I created a new view and the join auto-populated. After that I selected what I wanted the Buyer in tbl_List to see. I created a new DataPage report, selected my newly created view, and proceeded normally. Hopefully this information can help some people, it took me a while to figure out after reading the how-to documentation (all it took was one oddly placed sentence in this how-to to figure it out http://howto.caspio.com/views/creating- ... ables.html). I guess I was going at it the completely wrong way (although it doesn't allow me to compare checkboxes to text fields, this will have to do for now). Quote Link to comment Share on other sites More sharing options...
lockedgroove Posted February 4, 2013 Author Report Share Posted February 4, 2013 It looks like I may have jumped the gun here a little bit. It turns out that the solution I posted in the last reply works if you have views made for each person who searches (which will not work long-term). I have reformatted my tables and removed the checkboxes as dropdowns and now want to compare one field in a table to many fields in another. An example would be in tbl_ListProducts, a buyer wants Product X. A seller (when creating the account would select what they sell, so we could say Product X, Product Y, and Product Z) would see that a buyer wants Product X and be able to see it. If a buyer wanted Product A, Product B, or Product C, the seller would not be able to view this listing and not show up in the search. Is there any suggestions for restricting searches with multiple variables against one variable in another table? Lookup table by RLS does this, but it only does one variable to one variable in each table. Quote Link to comment Share on other sites More sharing options...
nakatsu Posted February 4, 2013 Report Share Posted February 4, 2013 Thanks your code, but i don't understand, Could u explain for me, please?? Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.