如何停止按回车键提交表单?

how to stop form submition on enter key?

我不想提交表单。
当我在文本框上按回车键时,我的表单会自动提交并重新加载。

如何停止提交表单?

我的代码是。

<form class="cart" id="cart-frm" style="margin-bottom: 10px; ">
    <div class="row">
        <div class="quantity col-md-6 col-sm-6 col-xs-6" style="width:auto;" >
            <label style="float: left; margin-top: 10px" for="quantity">Quantity : </label> 
            <span>&nbsp;</span>
            <input style="float: right;" type="text" class="input-text qty" id='qty' title="Qty" value="1" name="quantity" min="1" step="1">

        </div>
        <div class="quantity col-md-6 col-sm-6 col-xs-6 pull-right">                            
            <button type="button" style="float: right;"   id ='<?php echo $product['id']; ?>' class="btn btn-primary btn-icon add-to-cart-product"> Add to cart</button>
        </div><br>    
    </div>
    <span class="clearfix"></span>
</form>
<script type="text/javascript">
    document.getElementById("cart-frm").onsubmit = function(){
        // if needs to be submited - return true
        // else - return false
        return false;
    };
</script>