stamper
12-Mar-2007, 02:33 AM
Hi...
I am fairly sure this is going to be a computational related question. So, here goes.
On my form, I collect a mobile phone number. As it is used for automatically SMS'ing the person, it has to be in the format of +61419555555. ie Country code, No leading "0" and then the number.
I have a drop list to select the country, which adds the +61 etc and a field to collect the phone number.
The problem is, if the person fills out the phone number with the leading "0" or uses spaces, dashes, brackets etc in the phone number, then the SMS will not be sent.
In most countries, mobile phone numbers start with a "0", but, not in North America.
So, what I need to do is:
1. take out the leading "0" IF it is exists
2. strip out any non numerical characters
3. derive the country code and the mobile phone number
Using a formatting condition wont really work, as I dont wont people filling in the number, and then ending up at an error page saying that they need to re-enter the number in the correct format.
SO, there you have it. Hope this all makes sense.
I am fairly sure this is going to be a computational related question. So, here goes.
On my form, I collect a mobile phone number. As it is used for automatically SMS'ing the person, it has to be in the format of +61419555555. ie Country code, No leading "0" and then the number.
I have a drop list to select the country, which adds the +61 etc and a field to collect the phone number.
The problem is, if the person fills out the phone number with the leading "0" or uses spaces, dashes, brackets etc in the phone number, then the SMS will not be sent.
In most countries, mobile phone numbers start with a "0", but, not in North America.
So, what I need to do is:
1. take out the leading "0" IF it is exists
2. strip out any non numerical characters
3. derive the country code and the mobile phone number
Using a formatting condition wont really work, as I dont wont people filling in the number, and then ending up at an error page saying that they need to re-enter the number in the correct format.
SO, there you have it. Hope this all makes sense.