Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Easy PHP or Javascript selector for a site.

edited January 2006 in Vanilla 1.0 Help
As I'm gradually working my way on the new company site, we need some sort of widget to select products with some parameters. Basically the parameters are number of people and how large their house is. Can someone point me a direction? Or help me out here?

Comments

  • Not sure what you want- give me a context and maybe i'll understand it
  • It's really simple. You have a list of products and then you have a form, you put the number of people living in your house and the size of the house (5 persons and 200m2 for example) and it gives the product that fits the requirements.
  • Kosmo, no matter how you slice it, it's just a matter of simple (complex if you're doing it in JS) elimination and rewrites. Pretty sure you could figure this out if you plot it out with cases in php (for the quick and dirty) and I'm certain the same applies in JS. I think the JS will give you more of a headache due to the fact that some browsers won't render it :/
  • I was thinking ways of making it, basically it is just a bunch of ifs and elses, but the problem comes from two different values, since with 5 people and 150m2 you get one product and with 5 people 200m2 you get other, but when it is 6 peoples and 150m2 you get the second one again and not the first one, so it just takes time to figure it out. I might be able to code it in RoR, but since the host suscks ass, they don't support awesome future technologies so I have to do it with caveman style.
  • move hosts :D Sounds like you've got a fun project on your hands.
  • It is tons of fun, but the most bitchy thing is that I'm working on this whole site project on all my own. I'm not a coder, I'm a graphics designer, so this kind of thing takes me ages to figure out how to do it.
  • If the possible entry values for #people and square foot are known then I would just make 2 select boxes and hardcode your expected values. THen for the code part, make an array that contains the known results of all choices. a[people][sqft] so you have a[1][100] = product1, a[2][150]=product2, etc......for as many different outcomes as you have. Then when your user fills in the form, with say xpeople, ysqft, your desired product is a[xpeople][ysqft] without any searching or ifs, or select case, etc....
This discussion has been closed.