Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By enttsh
#830247
Hi,

We want to prevents input data duplicate in grid per APP_UID with JavaScript code
and would like a pop-up message e.g. "Duplicate ID card" when clicking on submit button.

I have attached the image.

please send us the JavaScript code
Attachments
ID Card.JPG
ID Card.JPG (25.75 KiB) Viewed 3468 times
By chieunh
#830276
Example:
Code: Select all
$("#buttonId").on("click", function() {
    var grd = $("#gridId");
    for (var i=1; i <= grd.getNumberRows(); i++) {
        let isExist = false;
        let idCard = grd.getValue(i, 1);
        if(findIdCardInGrid(idCard)){
            alert("Duplicate ID card");
            return;
        }    
    }   
});

function findIdCardInGrid(idCard) {
    let isExist = false;
    for (var i=1; i <= grd.getNumberRows(); i++) {
        if(idCard == grd.getValue(i, 1)){
            isExist = true;
            break;
        }
    }
    return isExist;
}
By enttsh
#830283
chieunh wrote: Tue Oct 25, 2022 10:09 am Example:
Code: Select all
$("#buttonId").on("click", function() {
    var grd = $("#gridId");
    for (var i=1; i <= grd.getNumberRows(); i++) {
        let isExist = false;
        let idCard = grd.getValue(i, 1);
        if(findIdCardInGrid(idCard)){
            alert("Duplicate ID card");
            return;
        }    
    }   
});

function findIdCardInGrid(idCard) {
    let isExist = false;
    for (var i=1; i <= grd.getNumberRows(); i++) {
        if(idCard == grd.getValue(i, 1)){
            isExist = true;
            break;
        }
    }
    return isExist;
}



thanks a lot
would u please help me in this topic too?
https://forum.processmaker.com/viewtopic.php?f=41&t=738366

Being the best in the started business is the obje[…]

Winzo is a popular and unique game on the mobile p[…]

Cannot create process using templets

Real details. The problem was solved by effect!

However, it is essential to use it responsibly and[…]