View Full Version : help with a website

08-22-2012, 10:59 PM
I need help or pointed in the right direction please!

I am trying to develop a website. On this website, I need users to be able to choose options, and based on the options they have chosen, it will bring up results fitting those choices. If that makes sense?

For example a user might be looking for rock climbing locations in a particular city, based on what city they choose it will then bring up the results of the nearby places.

I have no idea how to build a funtion like that.

08-23-2012, 08:05 AM
It depends on how much data you have. If you dont have much data you can use javascript. Here is a script I wrote that populates a list using the selection box.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
places = [{city: 'Auckland', place: 'Sky Tower'},{city: 'Auckland', place: 'Piha'},{city: 'Wellington', place: 'Te Papa'}]
var city = $(this).val();
$.each(places, function(index, value){
if(value.city == city){
<select class="city">
<p class="selectedCity"></p>
<ul class="results"></ul>

If you have a large amount of data, you may want to store the data in a database and use a php script to retrieve the data and display it in the browser. check out these tutorials for information on PHP and MySQL:

08-26-2012, 09:37 PM
thanks for the script, helpful!

Aug 25, 2012

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum