Click here to Skip to main content
16,019,427 members
Home / Discussions / JavaScript
   

JavaScript

 
Questiondata import via API Pin
Francesco Reboldi23-Sep-21 19:28
Francesco Reboldi23-Sep-21 19:28 
AnswerRe: data import via API Pin
Afzaal Ahmad Zeeshan23-Sep-21 23:47
professionalAfzaal Ahmad Zeeshan23-Sep-21 23:47 
GeneralRe: data import via API Pin
Afzaal Ahmad Zeeshan24-Sep-21 4:11
professionalAfzaal Ahmad Zeeshan24-Sep-21 4:11 
GeneralRe: data import via API Pin
Francesco Reboldi24-Sep-21 5:13
Francesco Reboldi24-Sep-21 5:13 
GeneralRe: data import via API Pin
Francesco Reboldi25-Sep-21 6:26
Francesco Reboldi25-Sep-21 6:26 
QuestionRegex not keeping the . or decimal with currency value with keydown event. Pin
jkirkerx23-Sep-21 9:06
professionaljkirkerx23-Sep-21 9:06 
AnswerRe: Regex not keeping the . or decimal with currency value with keydown event. Pin
Member 1532961323-Sep-21 9:32
Member 1532961323-Sep-21 9:32 
GeneralRe: Regex not keeping the . or decimal with currency value with keydown event. Pin
jkirkerx23-Sep-21 9:39
professionaljkirkerx23-Sep-21 9:39 
I was thinking the same thing at first. Maybe I need to rethink this.
It's a html element textbox, so like a phone number formatter, it's a currency formatter where you type in say 125.00 or 65.47
It will reject alphabet letters.

I copied it from my phone number formatter, and used the same principals, well at least I think I did.
function formatPhoneNumber12(value) {

    if (!value) return value;<br />
    const phoneNumber = value.replace(/[^\d]/g, "");<br />
    const phoneNumberLength = phoneNumber.length;

    if (phoneNumberLength < 4) return phoneNumber;

    if (phoneNumberLength < 7) {
        return <code>${phoneNumber.slice(0, 3)}-${phoneNumber.slice(3)}</code>;
    }

    return <code>${phoneNumber.slice(0, 3)}-${phoneNumber.slice(
        3,
        6
    )}-${phoneNumber.slice(6, 9)}</code>;
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com

GeneralRe: Regex not keeping the . or decimal with currency value with keydown event. Pin
Member 1532961324-Sep-21 1:07
Member 1532961324-Sep-21 1:07 
AnswerRe: Regex not keeping the . or decimal with currency value with keydown event. Pin
jkirkerx29-Sep-21 12:19
professionaljkirkerx29-Sep-21 12:19 
GeneralRe: Regex not keeping the . or decimal with currency value with keydown event. [Perhaps Solved] Pin
jkirkerx29-Sep-21 13:18
professionaljkirkerx29-Sep-21 13:18 
QuestionHow does the compare function work with numerical sort? Pin
Ryan Blake 202126-Aug-21 15:51
Ryan Blake 202126-Aug-21 15:51 
AnswerRe: How does the compare function work with numerical sort? Pin
Peter_in_278026-Aug-21 18:22
professionalPeter_in_278026-Aug-21 18:22 
GeneralRe: How does the compare function work with numerical sort? Pin
Ryan Blake 202128-Aug-21 13:45
Ryan Blake 202128-Aug-21 13:45 
QuestionBrowser Side Recovery Pin
milo-xml3-Aug-21 9:06
professionalmilo-xml3-Aug-21 9:06 
AnswerRe: Browser Side Recovery Pin
Richard Deeming3-Aug-21 23:48
mveRichard Deeming3-Aug-21 23:48 
GeneralRe: Browser Side Recovery Pin
milo-xml4-Aug-21 3:20
professionalmilo-xml4-Aug-21 3:20 
Questioni have been learning javascript for a long time now but still dont know what to build Pin
samuel unachukwu23-Jul-21 22:47
samuel unachukwu23-Jul-21 22:47 
AnswerRe: i have been learning javascript for a long time now but still dont know what to build Pin
SeeSharp226-Jul-21 8:51
SeeSharp226-Jul-21 8:51 
AnswerRe: i have been learning javascript for a long time now but still dont know what to build Pin
Bohdan Stupak30-Jul-21 4:10
professionalBohdan Stupak30-Jul-21 4:10 
AnswerRe: i have been learning javascript for a long time now but still dont know what to build Pin
Mate Peric5-Aug-21 14:35
Mate Peric5-Aug-21 14:35 
Questionwhat to study after javascript? Pin
E-FANIE Rh19-Jul-21 9:16
E-FANIE Rh19-Jul-21 9:16 
AnswerRe: what to study after javascript? Pin
SeeSharp219-Jul-21 9:44
SeeSharp219-Jul-21 9:44 
GeneralRe: what to study after javascript? Pin
Miguel Santico21-Jul-21 17:50
professionalMiguel Santico21-Jul-21 17:50 
AnswerRe: what to study after javascript? Pin
Bohdan Stupak30-Jul-21 4:04
professionalBohdan Stupak30-Jul-21 4:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.