Is this even possible to code?

This is strictly client based only( Does not apply to web design):

I have code that I’ve modified that will format a phone number into the following: (847) 999-1212. The user enters a 10 digit number and upon exiting the field the formattting takes place, all is good!!

My question is this: Is there anyway to code the field so that the OpenParen and Closed Paren and dash are already displayed on the screen?

( ) -

If I put the symbols as a Default Value they move once the user begins entering data.

Is this possible to do? Please provide some direction.

Thank you

ccl

Subject: Is this even possible to code?

Not sure if this is contrary to what the user is expecting but how about the “old school” approach? Have three separate fields for the area code and both parts of the phone number, each field being separated by static text parens and dash. Not very elegant but if the user insists on seeing them . . . .

hope that helps.

Subject: ROFL! was about to suggest the same thing :smiley: -eom-

Subject: Is this even possible to code?

so what exactly do you want to happen then, the user to click into the field and be placed inside the parens automatically, then after they type the first 3 numbers move them outside the right paren then after the type 3 more numbers move them to the right of the hyphen? Even if it can be done this would probably be less user friendly than what you have setup already. If you are expecting different please explain in detail as I have.

Subject: RE: Is this even possible to code?

Paul, that is exactly what the user wants, just as you described. I agree with you, I think my way is more user friendly in that they just enter ten numbers and when they exit the field, , it gets formatted.

The user wants the open Paren, Closed Paren and dash to be displayed within the field and when they enter they then enter the 3 numbers for area code, the paren does not moved, then place cursor outside the right paren and they type the three digit prefix…

Is this possible?

Thanks for your reply

ccl

Subject: RE: Is this even possible to code?

Ok I dont know if this will help or not but I have definitely seen this functionality at work in PDF editable forms.

They will format inline as you type - VERY cool on the UI.

I suspect he has seen this type of behavior in a PDF and thats where his expectation came from.

Subject: Is this even possible to code?

The only method I’m aware of to get a keystroke event in the Notes client is to use a keywords-type field that allows values not in field (a combobox is the norm for this) and set it to refresh fields on keyword change. But even if you could eliminate the spaces that user input would generate on the fly, positioning the cursor would be well nigh impossible (or even actually impossible). I think this is a no-go.

Subject: RE: Is this even possible to code?

It’s too bad onKeyDown/Up isn’t available in the client… I thought this was pretty cool – How to auto-format phone numbers and mask telephone numbers using Javascript