summary refs log tree commit diff
path: root/client/main.js
blob: 652776aeac00397dc61a98dbcb557a9e4fe3ea9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function onFormSubmit() {
    return false;
}

function inputUpdate() {
    const pattern = /^(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?&/;
    const userInput = document.getElementById('url').value;
    if (pattern.test(userInput)) {
        document.getElementById('form-group').style.borderColor = '#E0E0E0';
    } else {
        document.getElementById('form-group').style.borderColor = '#FFBCBC';
    }
}