pascal87
Newbie
Posts: 1
Registered: 3/24/2005
Member Is Offline
|
| posted on 3/24/2005 at 12:29 AM |
|
|
Error with "city" input
I noticed there is an error if there is a city name two words. For example, inputting "New York" would give an error, but "New" would not. Does
anyone know a fix for this?
|
|
|
billyp1970
Junior Member
Posts: 5
Registered: 3/27/2005
Member Is Offline
|
| posted on 3/27/2005 at 05:28 AM |
|
|
Already Posted
The solution to your problem has already been posted...but in case you didn't see it add these lines in the validation.js under "//check
length"...I checked it out it works awsome.
else if (String(this.a_fields[n_key]['v']).length > 0) {
var space = ' ';
// assume that string is all spaces
var spflag = 1;
// loop through string and stop if anything other than white space found
for (var i=0; i < String(this.a_fields[n_key]['v']).length; i++) {
if (space.indexOf(String(this.a_fields[n_key]['v']).charAt(i)) == -1) {
spflag = 0;
break;
}
}
if (spflag != 0) {
this.a_fields[n_key].n_error = 1;
n_errors_count++;
}
}
|
|
|
tigra
Administrator
Posts: 1990
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 4/7/2005 at 02:41 PM |
|
|
or you can just replace one line in validator.js:
| Code: |
'alpha' : /^[a-zA-Z\.\-]*$/,
|
to
| Code: |
'alpha' : /^[a-zA-Z\.\-\s]*$/,
|
|
|
|