How to indicate the phone number format ?

How to indicate the phone number format ?

jyd0228jyd0228 Posts: 30Questions: 11Answers: 0

I have 3 questions.

1.See Figure Q-1
How to indicate the phone number format?
When 01012341234 data is input in the editor, the screen should appear in the format 010-1234-1234 (xxx-xxxx-xxxx).
And when entering this data into the DB, I want to enter only 01012341234 with the -(hyphen) removed.

  1. See Figure Q-2.
    The corresponding inputbox represents the registration date
    I applied "def: function () {return new Date(); }" to this box.
    I would like to disable this box so that today's date is entered but cannot be modified.
    So I applied "type: "readonly"" but the type is different.
    What option should I put in the type?

3.See Figure Q-3.
I want to center the deal price, deal amt column, and right align the data.
What should I do?
I align the entire table (id=acontDtlMng) in the center and these columns are sorted in className: right,
it appears as shown in the picture.

This question has accepted answers - jump to:

Answers

  • jyd0228jyd0228 Posts: 30Questions: 11Answers: 0
    edited January 2021

    Can't edit the article?
    I cleared problems Q-2, Q-3.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You can use jQuery mask for that - see example here. I re-used the age column, but this now behaves like the Zip code that you want.

    Colin

  • jyd0228jyd0228 Posts: 30Questions: 11Answers: 0

    Hello Colin,

    I added the mask libraries and set it as shown, but the "Uncaught Error adding field - unknown field type mask" error appears.
    Is there anything else I need to set up?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Check all the libraries that are in my example, and the ordering will be important too, so make sure they're in the same sequence.

    Colin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Try putting mask after jQuery - I just noticed in your screenshot it's before.

    Colin

  • jyd0228jyd0228 Posts: 30Questions: 11Answers: 0

    I moved the mask libraries behind jQuery but I get the same error....

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Ah, you probably need to include editor-mask field type - I pasted the code into that example in the JS tab as there's a restriction against using field plugins on the example site.

    If you add that file in, in the same place/order as in my example, you should be good to go,

    Colin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Note you need to be logged into the site with the account that has the Editor license to be able to see the download section of that page.

    Colin

This discussion has been closed.