So I want to be able for the user to add hyphens into their phone number(s) when entered into a form I have.
Whenever I add hyphens to the phone number field it pushes the hyphens to the very front for some reason, like this
but I want it to stay like this
Here's my code
a!textField( label: "Contractor's Phone Number", labelPosition: "ABOVE", value: ri!record['recordType!{d327a5dc-18d4-4ffd-8bdf-6a22b134677f}DS Contractor.fields.{f2502f28-185b-4cdb-87eb-56e09d28d249}conphoneNum'], saveInto: ri!record['recordType!{d327a5dc-18d4-4ffd-8bdf-6a22b134677f}DS Contractor.fields.{f2502f28-185b-4cdb-87eb-56e09d28d249}conphoneNum'], refreshAfter: "UNFOCUS", required: true, characterLimit: 12, validations: {} )
Discussion posts and replies are publicly visible
Could it be that you defined that record field as a number? Try to change this to text.
It does seem to be an integer. However it's also my primary key, so it won't let me change or delete it. Is there a way to do either?
Using a value entered by a user as a primary key seems to be a bad idea. I recommend to have a separate field "id" (integer) defined as auto generated primary key. Then store the phone number in a text field.
I didn't want it to be my primary key, but I do have an ID field. I still need to store the phone number though, so I guess I could just switch the names?
a!textField( label: "Phone Number", value: { text( ri!number, "000-000-000" ) }, saveInto: ri!number )