none
RE: Libraries for Country forms RRS feed

  • Question

  • I need to build some multi-country websites in various languages. 

    Example, I'll build a web form but I need to collect City, State, County, Postcode and phone numbers. 

    Are there any libraries that will help me with collecting information from users with prebuild dropdowns for the above in .net/core or aspnet/core?

    If I have to do this for each country, I'll never be able to complete this work. 

    Thanks in advance


    • Edited by ResidentX10 Thursday, October 4, 2018 12:26 PM
    Thursday, October 4, 2018 12:24 PM

All replies

  • Hi,

    Not sure why you need to collect info like City/State/Country. There are other ways to build multi-language web sites using resource files. Look at below samples and forums thread -

    https://code.msdn.microsoft.com/AspNet-Multilingual-WebSite-6db1ec9b

    https://forums.asp.net/t/1528005.aspx?How+i+develop+multi+language+website+in+asp+net

    Let us know if you are looking for any specific implementation and elaborate more to understand your issue.


    Thanks,
    Vivek Bansod
    Blog | MSDN | LinkedIn
     

    Friday, October 5, 2018 4:42 AM
  • I'd just import the country/city list on here (note: multiple lists) with Excel web import tool and call it a day.

    just make sure "city" is combobox so if the user lives in relatively small city, they can still type the name there.

    If you need state name and postal code, it's trival to find a place with such information, but I'll probably just implement it for one country or two. If the people assign you to do this want more, it's your right to ask them provide the data. Remember, you're developer, not data entry clerk.

    ======

    Btw, if you really need that, you may download information from this site. Note that their terms of usage require you to put their name on your site if you want to use their data, so you'll need to acquire permission from project owner before using them.


    Tuesday, October 9, 2018 2:09 AM
    Answerer
  • Hi Vivek,

    Let me tell you more details. Thanks for the comment. I forgot to check the "alert me" box and so I haven't seen these emails. 

    I'm building a marketing web database and in each country I need to collect user info:

    Name

    Business

    Address1

    Address2

    Address 3

    City

    State/Region

    Country

    Postcode

    Work Number

    Mobile Number

    Role

    Each country requires data to be in country so I have to use build forms collect that information


    • Edited by ResidentX10 Wednesday, October 10, 2018 5:09 AM
    Tuesday, October 9, 2018 12:02 PM
  • Cheong00

    I like your suggestion but I need to control how data is entered into the database/form or the data collected will be useless.

    Examples: 

    1. UK, GB, Great Britain

    2. US, USA, America


    • Edited by ResidentX10 Tuesday, October 9, 2018 12:06 PM
    Tuesday, October 9, 2018 12:05 PM
  • Just create additional table to store the name alias than.

    In your onchange handler, if the country name entered is not found, compare with that additional mapping list. If found, use the mapped value to do the query and fill the list for related combobox. Optionally replace the country name with mapped value too.


    Tuesday, October 9, 2018 11:58 PM
    Answerer
  • I appreciate the comment Cheong00 but I need to "steer" the user. I can't have users keying in whatever they want. This becomes a security violation. 
    Saturday, October 20, 2018 1:26 PM
  • There will not be security violation as long as your code properly sanitize the input, and you're using parameterized SQL queries.

    Talking about sanitation and validation of address, you may want to examine whether Google Map API fits your purpose.

    Saturday, October 20, 2018 4:45 PM
    Answerer