knockout.js Bindings - Form fields submit


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

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

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

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.