Need to write some javascript code according to your submit button and textbox.
Javascript Code:
<script type="text/javascript">
function clickSubmitButton(e) {
if (e.keyCode == 13) {
document.getElementById("Your submit button id here").click();
}
}
</script>
Then need some change in your code:
<div>
<input id="add" onkeypress="clickSubmitButton(event)" type="text" style="width: 40%" />
<button id="btnAdd" type="submit" data-bind="click: $root.AddGoal">Add</button>
</div>
Try this...