How would I be able to send a Popup upon submitting a form when a user doesn’t exist?

Solution
    document.getElementById().onsubmit = function() {

    }