Phone Number Is Invalid

[QUOTE]I suggest removing all digits checks entirely.[/QUOTE]



I agree with you Jesse in that this would be the overall best way to handle this. Field validation certainly has it’s place, however, when it comes to phone numbers, flexibility in allowing a customer (from whatever country) to enter it the way it is best suited for them is needed.


[QUOTE]My english is bad, I know that but what I meant is that:[/QUOTE]



No, your English is pretty good and you communicate just fine Indy! Actually your English is far better than my foreign lanquage speaking abilities, Irish, or otherwise! :smiley: Now, go make yourself a “Coma” and see how much better your English lanquage speaking abilities get!

[quote name=‘Struck’]I agree with you Jesse in that this would be the overall best way to handle this. Field validation certainly has it’s place, however, when it comes to phone numbers, flexibility in allowing a customer (from whatever country) to enter it the way it is best suited for them is needed.







No, your English is pretty good and you communicate just fine Indy! Actually your English is far better than my foreign lanquage speaking abilities, Irish, or otherwise! :smiley: Now, go make yourself a “Coma” and see how much better your English lanquage speaking abilites get![/quote]

I’m watching TV, “The Lost City” and then …

I think we need to specify boundaries for the fields. Maybe something like having the capability to either have no restrictions, the default syntax, if that is what you want, or to put in a custom regexp into the each field in the ADMIN, something like what we can do with text box, text field options.

I don’t like the field wide open to anything. I think code could be injected into fields if no restrictions. Also, I believe I may have problems when importing the telephone numbers into Quickbooks and Endicia (which enters phone number for international custom forms) and other programs which may not be able to handle excessive lengths and characters in some fields.

Bob

I also have issues with the US validation, as I need customers to enter Australian format numbers which won’t validate.



A quick fix I use is to go into the database (via phpMyAdmin or similar) and edit the table: cscart_profile_fields



Find “phone” and change it to field_type I instead of P



Then users can then enter their number in any format they like as the phone filed validates as an ordinary input field.

Yes, PLEASE get rid of this phone number format validation.



I cannot register on my own site using a valid phone number.



I am now also looking through error logs and we are crating a LOT of frustrated potential customers instead of money due to this “feature”



I vote for immediate removal of this obstacle.



V.

Is there a way to limit the phone field to



numeric

plus symbol

spaces



and is the code the same for 1.35sp4?



Help greatly appreciated



Thanks



Stephen








[quote name=‘jobosales’]You can find the phone # validation routines in /js/core.js. You will need to modify the code there:

phone: function(val)
{
var digits = '0123456789';
var valid_chars = '()- +';
var min_digits = 10;
var bracket = 3;
var brchr = val.indexOf('(');
var s = '';

val=jQuery.trim(val);

if (val.indexOf('+') > 1) {
return false;
}
if (val.indexOf('-') != -1) {
bracket = bracket + 1;
}
if ((val.indexOf('(') != -1 && val.indexOf('(') > bracket) || (val.indexOf('(') != -1 && val.charAt(brchr + 4) != ')') || (val.indexOf('(') == -1 && val.indexOf(')') != -1)) {
return false;
}

for (var i = 0; i < val.length; i++) {
var c = val.charAt(i);
if (valid_chars.indexOf(c) == -1) {
s += c;
}
}

return (jQuery.is.integer(s) && s.length >= min_digits);
},




Bob[/QUOTE]

[quote name=‘pbannette’]I think we need to specify boundaries for the fields. Maybe something like having the capability to either have no restrictions, the default syntax, if that is what you want, or to put in a custom regexp into the each field in the ADMIN, something like what we can do with text box, text field options. Business Telephone Systems

I don’t like the field wide open to anything. I think code could be injected into fields if no restrictions. Also, I believe I may have problems when importing the telephone numbers into Quickbooks and Endicia (which enters phone number for international custom forms) and other programs which may not be able to handle excessive lengths and characters in some fields.

Bob[/QUOTE]



Seems like it shouldn’t be a problem to just put very loose limits on teh field. The only problem with not having any kind of validation is that it won’t catch when someone makes a mistake entering their number (maybe 2 fields that get compared? for confirmation?)