Save a phone number without the input mask
Hi,
I actually have 2 related issues that I hope you might be able to help me with.
I have a form linked to an interactive report, so when I click a record, the form is populated with the record's data. I just started using the new text field masked input plugin to handle phone number formatting, etc., which Patrick recommended.
The plugin works nicely when a phone number being displayed from the source is 10 characters. The input mask I'm using is (999) 999-9999. However, I also have phone numbers in records that don't include the area code. When I select one of those records, the phone number field is blank. I would like it to display 999-9999, and be right justified. Is there an easy fix for that?
My next problem occurs when I try to save the record. The process tries to save the phone number, including the mask, (14 characters), to the table. I only want to save the number to the table, excluding the mask. I'm sure there is a way to do this but I haven't found it yet.
Thanks in advance for any help,
Gary
This is my solution to parsing the number only from the masked phone number:
1) Create a field, 'P1_PHONE_MASKED', with a phone number mask: (?***) 999-9999
2) Create a hidden Database Column like: 'P1_PHONE' It will initially hold the value of the record's phone column.
3) create a javascript function in the page's before header section, between the space tags, to strip out all non-numeric values and update the hidden field:
function remmask(src,tar){
var mystring = $x(src).value;
mystring = mystring.replace(/\D/g,'');
$x(tar).value = mystring;
4) Place the function call in the from in the HTML Form Elements Attributes of P1_PHONE_MASKED: onBlur="javascript:remmask('P1_PHONE_MASKED','P1_PHONE');"
Now, anytime you change the value in P1_PHONE_MASKED, P1_PHONE gets updated with just the number values from P1_PHONE_MASKED.
You can also add validation to the function to ensure that the length of the phone number is either 7, no area code, or 10, including area code. Normally, the mask should handle validation, but as you can see, to make this work, I had to make the mask more flexible, to allow for alpha numeric values in the first 3 positions and to allow for either 7 or 10 characters. Unfortunately, that means a user could enter something like XXX12 and the mask won't reject it.
Partial solution to displaying ( ) 999-9999 in the masked input field P1_PHONE_MASKED when initially selecting a record for display.
1) Make the Source Type for P1_PHONE_MASKED "SQL Query"
2) Insert a query similar to the one below into "Source Value or Expression"
SELECT
CASE
WHEN length(METAREPO.CONTACTS.CONTACT_PHONE) = 10
THEN
METAREPO.CONTACTS.CONTACT_PHONE
WHEN length(METAREPO.CONTACTS.CONTACT_PHONE) = 7
THEN
'___'||METAREPO.CONTACTS_2011.CONTACT_PHONE
END
FROM METAREPO.CONTACTS
WHERE METAREPO.CONTACTS.CONTACT_ID = :P1_CONTACT_ID
This will display 7 digit phone nubers as follows: (___) 999-9999 in the masked field: P1_PHONE_MASKED.
I wanted to use spaces between the () to make it perfect, but I'm unable to get this to work. I've tried things like:
' '||METAREPO.CONTACTS_2011.CONTACT_PHONE
LPAD(METAREPO.CONTACTS_2011.CONTACT_PHONE,3,' ')
Both of which work in PL/SQL Developer, but not in Apex. I believe this is because HTML collapses spaces by default.
I would like very much to resolve this last issue. Any suggestions?
Regards,
Gary
Similar Messages
-
After downloading viber application , I was asked to enter my phone number without the country code, when I enter my phone number and pressed continue, I get this error "viber can't access push notifications. Check settings > notifications. Check internet connection and try to register again. see viber.com/notifications for more info. I have checked the notifications and it is on also I have checked the internet connection and it is active, so what shall i do now to get my viber code?
Contact Viber customer/technical support.
-
How do I disable imessage to a phone number without the phone?
I switched from my iphone 4 to the galaxy note 3. I love the phone but whenever iphone users text me it is still sending in imessage. This is obviously an issue because a lot of my friends have an iphone still. I have went into my account and disabled all devices on the icloud. I have also turned off imessage on my ipad and my parents imac. When I switched my phones at the store they bought my iphone, so I do not have the option to turn it off on that. I need a solution to where imessages only get sent to my email or just as SMS. I thought that when I switched I would have become unrecognizeable in imessaging, but obviously I thought wrong. Any help would be greatly appreciated.
Thanks Clyde. I called that number but they told me to go to icloud.com and delete the number while looking at it under Find My iPhone. It didn't change anything. Other iphone users can still send me imessages. Is there a way I can delete my whole account and basically unregister my information from the system?
-
I bought this phone from someone and then I unlocked it using that gevey sim i think -- using it for T-mobile..
I can't get Imessage to work on my phone number because the old number is there and it is grayed out and cannot be edited.
I can use it but not with my phone number, only with email.
Can someone please tell me how to fix this so that I can send with my number?
Thanks so muchThe advisor should not have told you this for legal reasons. There is no way of tracking the iPhones just of finding out which SIM cards were used to activate them and if they were activated at all. Court can authorize Apple to release this information to the count. There is no legal way without involving a judge.
-
i've backup in itunes with another phone number activation , now i want active with new phone number without losing old backups , what can i do for this problem ??
If I get this right, you've ported your phone number to AT&T with the purchase of the iPhone. That is considered opening your own account under your name. Your brother's account is not ported to AT&T unless you used his SS# instead of yours. Your brother still has his account under Verizon Wireless, all you did was use your cell phone number to when you opened your own AT&T account.
If you don't want to use your Verizon Wireless phone #, my suggestion is to call AT&T customer service and explain that you want a new phone number instead of the ported Verizon number. -
Hi, I want to iMessage an American phone number from the uk, how do I do this?
Hi, I want to iMessage an American phone number from the uk, how do I do this?
make sure you have the phone number entered in international format in your contacts. In settings/phone turn on dial assist. Then enter the US number as +1 (area code, if it has one) (phone number).
With dial assist on the + gives you the dial out code to make an international call, 1 is the country code for USA,for a mobile number it will not have an area code but if it has a leading zero leave it out, then the phone number without any leading zero -
My apple id account is setup with my dads cell phone number, so on my iMessages on my mac i get my dads texts messages, is there anyway to change it so my phone number is the one receiving messages on my mac?
Remove his phone number from your AppleID.
http://appleid.apple.com -
How can i remove the phone number from the text messages that i receive in the notification center
how can i remove the phone number from the text messages that i receive in the notification center?
You choose whether to see text messages in Notification Center or not. If you elect to see them, they will display the phone number (unless they are from a contact in your contacts list).
You can choose not to see them at Settings > Notification Center > Messages. -
How can i remove my phone number rom the imsg server
How can i remove my phone number from the imsg server
You can disassociate your phone number with your iMessages/Apple ID by turning off iMessages. Go to Settings -> iMessages -> Turn off iMessages. Wait a couple of hour to fully have your number unregistered with iMessages.
-
I have an I pad2, an iMac desktop(2012) and an I phone 5, how do I get them all to be able to face time with each other, do I need different email addresses, use the phone number, or the sim number in the iPad ? Any help gratefully received !!
Graham,
For the iPad, iMac you need to create verifyible e-mail addresses created with one of the providers such as Yahoo, Gmail,etc. For the iphone you should use it's phone number, but an e-mail could be used for it too. If you want to associate these e-mail addresses with a single ID, I'm including a link to give you info about how you can do that. Read it carefully, as it can be a bit confusing.
http://support.apple.com/kb/HE68 -
I just got the new Iphone 5 and when I send a message in a group text it keeps sending it as an email and as my phone number. The people in the group text are complaining that it is creating a new group message everytime I text. How do I fix this?
Read http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
If you wish to share an Apple ID with family members then read: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/ -
I need to get into contact with Adobe support on renewal of my CC subscription which does not work but I cannot find any PHONE number just the referral to this forum - help, what should I do?? Thanks!!
Use the web chat:
Contact Customer Care
Mylenium -
How do I view a video that was sent to me through imessage to my iphone 5S?It was sent by another iphone user.I clicked the link and entered my phone number and the password provided but it still won't open.What should I do?
Is this your issue > http://support.apple.com/kb/HT5818
If so...
The Apple ID and Password that was Originally used to Activate the iDevice is required
If you do not have that information you will not be able to use the Device. -
I have an Ipad2 and my daughter has Iphone 4s and I would like to have all SMS and IMessages duplicated on the IPAD2 I was told I could do this by typing in the mobile phone number into the IPAD2 some where in the settings.
Using FaceTime http://support.apple.com/kb/ht4319
Troubleshooting FaceTime http://support.apple.com/kb/TS3367
The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
http://tinyurl.com/a7odey8
Troubleshooting FaceTime and iMessage activation
http://support.apple.com/kb/TS4268
iOS: FaceTime is 'Unable to verify email because it is in use'
http://support.apple.com/kb/TS3510
Using FaceTime and iMessage behind a firewall
http://support.apple.com/kb/HT4245
iOS: About Messages
http://support.apple.com/kb/HT3529
Set up iMessage
http://www.apple.com/ca/ios/messages/
iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
http://support.apple.com/kb/HT5538
How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
Troubleshooting Messages
http://support.apple.com/kb/TS2755
Troubleshooting iMessage Issues: Some Useful Tips You Should Try
http://www.igeeksblog.com/troubleshooting-imessage-issues/
Setting Up Multiple iOS Devices for iMessage and Facetime
http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
FaceTime and iMessage not accepting Apple ID password
http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
Unable to use FaceTime and iMessage with my apple ID
https://discussions.apple.com/thread/4649373?tstart=90
FaceTime, Game Center, Messages: Troubleshooting sign in issues
http://support.apple.com/kb/TS3970
How to Block Someone on FaceTime
http://www.ehow.com/how_10033185_block-someone-facetime.html
My Facetime Doesn't Ring
https://discussions.apple.com/message/19087457
To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
How to Send SMS from iPad
http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
You can check the status of the FaceTime/iMessage servers at this link.
http://www.apple.com/support/systemstatus/
Cheers, Tom -
Hi all when I send a text to a contact (iphone4s) the contacts name changes to a phone number and the name is lost. I then have to resave it again, googled it but can't see anyone with the same issue, any ideas ?
There is another setting for "Start Conversation from", that needs to be set to phone number.
Maybe you are looking for
-
A problem with inserting into DB hebrew strings
Hi, I am working with a 8.1.7 DB version, and use thin driver. I have my DB Charest configured to iso 8859P8 (which is visual Hebrew) I have no problem in making a connection and retrieving strings, using SELECT * FROM .. and then use the ResultSet.g
-
Sony monitor attached to iMac suddenly blacks out
I have had a Sony monitor (model SDM-HS74P) attached to my iMac for over a year (and prior to that to my old iMac for several years) with no problem. Yesterday out of nowhere it blacks out. I have tried some troubleshooting things as per the Sony gui
-
No PSD thumbnails in Elements 12
Since I upgraded from 11 I've lost the ability to see the PSD thumbnails in either Organizer or Editor. Help.
-
hi guys i am new to macs I bought this for my daughter and tried to update.The update said to hold the program button and push power,well now she won't boot up just a grey sreen and what looks like a file with a blinking question mark and a face.. I
-
HT2736 How to gift a pre-ordered album on iTune?
I pre-ordered an album I want to send as a gift to my friend but I don't have the option gift anywhere. How can I do that? If I can't I would like to cancel the pre-purchase and I need to know what to do.