SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Separate Boxes for Address?

    Hi guys,

    Is there any advantage over having multiple boxes for a postal address, e.g. splitting it up into single-line fields for street address, town, county, postcode, etc, or is it better practice to go for a single multi-line (textarea) field?

    I'm looking at this in terms of usability best practice. What are your thoughts on this?

    Sam
    Sam Hastings

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I've learned that the more limits you try to place on an address, the more exceptions you have to make. For example, a dropdown list of states isn't useful if you have users in the UK or Canada.

    I haven't gone so far as to allow for a textarea as the only address field, but I'm trying to be more open-ended in the input I accept.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It depends on what you're going to do with the submitted data. If you're just going to use it for printing labels and invoices, use a single field and let the user format it as s/he likes.

    If you're going to make database queries based on geographic location, you'll need to separate the values before inserting the addresses into the database. In that case, using separate fields would be easier and safer. The problem, however, especially if you're serving an international audience, is that addresses are written differently in different countries. In the UK, for instance, they tend to write them on five or six lines, while a typical Swedish address only needs two lines. But we put the number before the street name, whereas Americans and others put the number last.

    So if you can keep it down to one field, do that. If not, make sure you're not putting up barriers for anyone.
    Birnam wood is come to Dunsinane

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by AutisticCuckoo
    But we put the number before the street name, whereas Americans and others put the number last.

    The typical address here is something like 104 Main Street

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia

    The typical address here is something like 104 Main Street
    Sorry, my poor excuse for a brain misfired there. I meant it the other way around.

    You'll write '104 Main Street' while in Sweden we'd use 'Storgatan 104'.

    Birnam wood is come to Dunsinane

  6. #6
    d^_^b Iain G's Avatar
    Join Date
    Nov 2005
    Location
    Gloucester, UK
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Separate fields for lines of the address make sense to me. You are making it clear to your user what level of detail you want to be provided.
    Coding and design philosophy:
    Keep It Simple, Stoopid

  7. #7
    SitePoint Guru LinhGB's Avatar
    Join Date
    Apr 2004
    Location
    Melbourne, Australia
    Posts
    902
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I often use this:

    - Address (street address, suburb, state etc.) : textarea
    - Postcode: text input
    - Country: text input
    - Phone: text input

    I've never done anything that requires queries on specific suburbs or street addresses, and I can't imagine any system that does (tell me if you know any example) so they should go in one field. The rest - postcode, country, phone - are common for all countries. If I need to do a query based on states, then the postcode (in combination with the country) can be used.
    "I disapprove of what I say,
    but I will defend to the death my right to say it."


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •