Wednesday, 14 February 2018

Call button on hit enter key in a text box

<script type="text/javascript">
    function ApplyFilterOnEnterKey(e) {
        if (e.keyCode == 13) {
            document.getElementById("_ctl0:mainContent:Search").click();
            return false;
        }
    }
</script>


Add the following attribute to the textbox:
onkeypress="return ApplyFilterOnEnterKey(event)"


No comments:

SQL: Generate a range of numbers

SELECT ones.n + 10*tens.n + 100*hundreds.n + 1000*thousands.n FROM       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) ones(n),      (VALU...