Можешь использовать атрибут
pattern.
<form method="get" action="index.php">
<input name="num" type="search" pattern="[\d()-]">
<button type="submit" class="search-button">Искать</button>
</form>
<script>
var inpElem = document.forms[0].elements[0];
inpElem.oninput = function() {
this.value = this.value.replace(/[^\d()-]/g, '');
};
</script>