﻿/* 
This script helps xform to submit even if the user clicks enter before marking the button, otherwise the searchbutton is default button for enter
Use it by wrapping the xForm with a div with the class="xForm" 
*/
$('.xForm input').keydown(function (event) {

    var key;
    key = event.which;

    if (key == 13) {
        var button = $(".xForm input[type=submit]:first");
        if (button != null) {
            button.click();
            return false;
        }
    }
});
