Below is a JS code , and i want to redirect user to two different URL - If he enter value in input box 1 so he should redirect to this Default url[<https://manage.bagful.com.au/cart.php?a=add&pid=30]> else he put more than 1 so this URL [<https://manage.bagful.com.au/cart.php?a=add&pid=30&configoption[2]]>

Here is the Code:

```
$(document).ready(function(){

    document.getElementById("input").addEventListener("keyup", function(event) {
        event.preventDefault();
        if (event.keyCode == 1) {
            var inputvalue = $("#input").val();
            window.location.replace(" https://manage.bagful.com.au/cart.php?a=add&pid=30");
        }
    });

    $('#button').click(function(e) {  
        var inputvalue = $("#input").val();
        window.location.replace(" https://manage.bagful.com.au/cart.php?a=add&pid=30&configoption[2]="+inputvalue);
    });
});

```

Please check and suggest the best idea.