I want to do some validations and alert the user i...
# suitescript
i
I want to do some validations and alert the user if the button bill remaining is being clicked
e
Check for the value of the button id which is submitter. The value is the text on the button.
i
Ended up doing it like this
Copy code
jQuery(document).ready(function() {
        pageInit();
    });
    function pageInit(context) {
        const fn = 'pageInit';
        try {
            console.log('test');
            jQuery('#billremaining').on('click', function () {
                let x = confirm('test');
                if  (!x) {
                    window.stop();
                }

            });
        } catch (error) {
            log.error({ title: `Error: ${fn}`, details: error });
        }
    };
e
what if the button doesn't exist?