knockout.js submit


Example

Event handler to be invoked when a DOM element is submitted.

<form data-bind="submit: doSomething">
    <!-- form content here -->
    <button type="submit"></button>
</form>

<script type="text/javascript">    
    var vm = { 
        doSomething: function(data){
            //do something here
        }; 
    }
</script>

Knockout will prevent the browser's default submit action for that form. If you want your form to be submitted like a normal HTML form, you just return true in the submit handler.