1

Topic: Validating City field in registration form

Ok, so ive been trying to seta  minimum length as well as alpha characters only for the city field but to no avail.

Does anyone know how i go about giving my custom fields  or in this case my City field a validation of that sort?

It seems users can just input numbers or 1 character and it still passes validation.

Cheers!

2

Re: Validating City field in registration form

Well, this is another demonstration that the script improving I am asking for since a long time it's needed by other people too smile
Gukkie, I asked Vlad to allow admins to use their own localities database into vldpersonals, so member will be forced to select Country, State and City from dropdown menus.
This way members will not make errors while subscribing and filling those fields. Moreover, results of profiles search based on locality will be more accurate.
At the moment this can be done just with a modification. See how it works on www.vldcrowd.com and try to register an account there. Then send a support ticket to Vlad.

Last edited by orange_slice (2011-12-20 12:17:39)

3

Re: Validating City field in registration form

Well, that was working on the old vldcrowd. I have a mod to auto populate the country->state fields according to the country chosen but i require a state database which i have no avail finding. I have been inputting the states manually and i've only managed to get a few done. It's not easy.

The only other method i see is to add a custom validation for the fields:)

4

Re: Validating City field in registration form

It can be done, as after much data searching and manipulation, I have in a set of 3 MySQL tables, :
* 6 world regions.
* These regions then break down into 241 countries (sorry if I missed yours)
* The regions then break down into 2,673,764 cities.

Each city has latitude and longitude (this allows for calculating the distance between cities).
The cities also have the old FIPS code, as well as the the newer ISO code.

This was a work in progress, and not completed, due to other commitments.
The issues to be next resolved was the accents used in city names, particularly when they appeared at the start of the city name, as I have no way of knowing, other than checking each one manually, if this is correct.
eg
Falaj al Mu`all in the United Arab Emirates
`Ayn al Faydah, also in the United Arab Emirates

The first is ok, the second shows the leading accent character sometimes used, sometimes not, so that part of the DB still needed to be cleaned up.

A long answer, but keep searching, and you'll find the info out there somewhere (I started this >12 months ago, then stopped, so can't initially recall where the data came from, but it was a combination from a few different sources, then some SQL queries to rationalize them (eg., some had FIPS but not ISO code)