Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Creating a searchable list

Options
  • 19-11-2009 2:02pm
    #1
    Registered Users Posts: 2,789 ✭✭✭


    I have to create a searchable list on a web page. The list is of 400 locations and there status eg;

    Dublin 44
    Paris 66
    London 77

    The the query would be;

    dublin = Dublin 44
    or
    Tokyo = no entry for tokyo

    What's the best way to do this Java or something else?


Comments

  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    In ASP.net I'd store it in a Datatable and use the Select function to retrieve the results


  • Registered Users Posts: 2,789 ✭✭✭grizzly


    Thanks, as this will be a one off for a very small site, I'm looking to keep it simpler.

    How about this – how would I go about creating a series of drop down menus that open up new options depending on the last input eg;

    1st menu
    >DUBLIN
    >LONDON

    if
    DUBLIN

    2nd menu
    >NORTH DUBLIN
    >EAST DUBLIN
    >SOUTH DUBLIN

    if
    LONDON

    2nd menu
    >NORTH LONDON
    >EAST LONDON
    >SOUTH LONDON


  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    grizzly wrote: »
    Thanks, as this will be a one off for a very small site, I'm looking to keep it simpler.

    How about this – how would I go about creating a series of drop down menus that open up new options depending on the last input eg;

    1st menu
    >DUBLIN
    >LONDON

    if
    DUBLIN

    2nd menu
    >NORTH DUBLIN
    >EAST DUBLIN
    >SOUTH DUBLIN

    if
    LONDON

    2nd menu
    >NORTH LONDON
    >EAST LONDON
    >SOUTH LONDON

    With 400 locations, I would recommend a simple relational database, with a table called 'Cities', and a table called 'Areas'.

    There would be a one to many relationship between Cities and Areas, meaning a City can have many areas.

    When you load the page, read the Cities table and put them as list items in a dropdown list. When the City is selected, load the areas for that city using it's primary key, and populate the results in the Area dropdown list.

    This is a very simple solution and will allow you to easily add new cities and areas, and modify the existing ones.

    It really depends what language or framework you use to do this. I know that in ASP.net you could have it done very easily. You could then Ajaxify it giving it a nice look and feel.


  • Registered Users Posts: 2,789 ✭✭✭grizzly


    That CascadingDropDown in the link you provided looks perfect. I've no experience of ASP.net. Can I ask, does it have to be specially enabled on the server on order to work? or does it work like javascript?


  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    grizzly wrote: »
    That CascadingDropDown in the link you provided looks perfect. I've no experience of ASP.net. Can I ask, does it have to be specially enabled on the server on order to work? or does it work like javascript?

    ASP.net isnt that dissimilar to PHP or Java. You create a page, click and drag a dropdown onto it, and then google 'ASP.net Bind Dropdownlist to database'. You'll find loads of tutorials showing you how to do it. I'm pretty sure you can do it using a GUI in visual web developer.

    That Ajax link I sent you is an extension to ASP.net, giving you client-side-like functionality. You'd still need a grasp on ASP.net to use it.

    I don't know how experienced you are, but there will be a learning curve to pick it up if your interested enough. With all the videos and tutorials on asp.net these days, its a lot easier than when I started!


  • Advertisement
Advertisement