Click here to Skip to main content
15,993,717 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: toLocaleString() works to insert commas in a asp.net textbox until I enter the eighth digit. The eight digit breaks the insertion of commas Pin
Richard Deeming9-Jul-24 5:44
mveRichard Deeming9-Jul-24 5:44 
GeneralRe: toLocaleString() works to insert commas in a asp.net textbox until I enter the eighth digit. The eight digit breaks the insertion of commas Pin
Jeremy Falcon17-Jul-24 16:13
professionalJeremy Falcon17-Jul-24 16:13 
GeneralRe: toLocaleString() works to insert commas in a asp.net textbox until I enter the eighth digit. The eight digit breaks the insertion of commas Pin
jsc428-Jul-24 22:49
professionaljsc428-Jul-24 22:49 
GeneralRe: toLocaleString() works to insert commas in a asp.net textbox until I enter the eighth digit. The eight digit breaks the insertion of commas Pin
fig00009-Jul-24 4:32
fig00009-Jul-24 4:32 
GeneralRe: toLocaleString() works to insert commas in a asp.net textbox until I enter the eighth digit. The eight digit breaks the insertion of commas Pin
jschell18-Jul-24 14:32
jschell18-Jul-24 14:32 
GeneralRe: toLocaleString() works to insert commas in a asp.net textbox until I enter the eighth digit. The eight digit breaks the insertion of commas Pin
fig000018-Jul-24 20:02
fig000018-Jul-24 20:02 
QuestionCan we use the NuGet package of .Net in WebDriverIO (JavaScript) framework? Pin
Anand Sabley20-Jun-24 20:44
Anand Sabley20-Jun-24 20:44 
QuestionProgressbar has a value of 100% before upload progress is finished Pin
Red Kipling4-Jun-24 9:34
Red Kipling4-Jun-24 9:34 
I upload a files in my website
I have this javascript code integrated to show the progress of upload
But the issue is that this bar has value of 100% before the upload is completed
How can i resolve this

JavaScript
function uploadFile() {
    const fileInput = document.getElementById('file1');
   

    const file = fileInput.files[0];
   
    

    const xhr = new XMLHttpRequest();
    xhr.open('POST', 'index.php', true);
    
    xhr.upload.onprogress = function (event) {
        if (event.lengthComputable) {
            const percentComplete = (event.loaded / event.total) * 100;
            const progress = document.getElementById('progress');
            progress.style.width = percentComplete + '%';
            progress.textContent = Math.round(percentComplete) + '%';
        }
    };

    xhr.onload = function () {
        if (xhr.status === 200) {
            alert('File uploaded successfully.');
        } else {
            alert('Error uploading file.');
        }
    };

    const formData = new FormData();
    formData.append('file1', file);
    xhr.send(formData);
}

AnswerRe: Progressbar has a value of 100% before upload progress is finished Pin
Richard Andrew x648-Jun-24 11:33
professionalRichard Andrew x648-Jun-24 11:33 
GeneralRe: Progressbar has a value of 100% before upload progress is finished Pin
Richard Deeming9-Jun-24 21:39
mveRichard Deeming9-Jun-24 21:39 
AnswerRe: Progressbar has a value of 100% before upload progress is finished Pin
jschell12-Jun-24 15:04
jschell12-Jun-24 15:04 
AnswerRe: Progressbar has a value of 100% before upload progress is finished Pin
Steve Raw17-Jun-24 10:34
professionalSteve Raw17-Jun-24 10:34 
QuestionProgressbar get only the size of first input Pin
Red Kipling2-Jun-24 0:43
Red Kipling2-Jun-24 0:43 
QuestionJqxTree control is taking time to load with 500 records Pin
yadta6-Feb-24 18:57
yadta6-Feb-24 18:57 
AnswerRe: JqxTree control is taking time to load with 500 records Pin
Richard Deeming6-Feb-24 21:33
mveRichard Deeming6-Feb-24 21:33 
GeneralRe: JqxTree control is taking time to load with 500 records Pin
jschell7-Feb-24 5:40
jschell7-Feb-24 5:40 
AnswerRe: JqxTree control is taking time to load with 500 records Pin
Prestige Somerville live27-Mar-24 20:10
Prestige Somerville live27-Mar-24 20:10 
Questionpassing 0 to a function Pin
mike741112-Jan-24 1:53
mike741112-Jan-24 1:53 
AnswerRe: passing 0 to a function Pin
Richard Deeming12-Jan-24 2:14
mveRichard Deeming12-Jan-24 2:14 
AnswerRe: passing 0 to a function Pin
Richard MacCutchan12-Jan-24 3:08
mveRichard MacCutchan12-Jan-24 3:08 
GeneralRe: passing 0 to a function Pin
mike741112-Jan-24 10:00
mike741112-Jan-24 10:00 
GeneralRe: passing 0 to a function Pin
Dave Kreskowiak12-Jan-24 12:46
mveDave Kreskowiak12-Jan-24 12:46 
GeneralRe: passing 0 to a function Pin
Richard MacCutchan12-Jan-24 22:08
mveRichard MacCutchan12-Jan-24 22:08 
GeneralRe: passing 0 to a function Pin
mike741113-Jan-24 0:48
mike741113-Jan-24 0:48 
GeneralRe: passing 0 to a function Pin
Richard MacCutchan13-Jan-24 1:55
mveRichard MacCutchan13-Jan-24 1:55 

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.