I've a simple search function which i Want to trigger on Enter key press, though the function executes but the form also get posted.
<script>
function search()
{
...
}
$(document).ready(function() {
$("#text").keypress(function (e) {
if (e.which==13)
search();
});
});
<body>
<form id="searchForm" name="searchForm">
<input size="40" id="text" type="text" name="text" class="input" />
</form>
</body>