Requirement was to add the daily task and the code shouldn't have any form and submit button.Also the task to be added with the enter key press.
On searching found couple of articles one about the prevention of form on enter key press and other from stackoverflow submitting a form on 'Enter' with jQuery?
Then i come up with my code.
JS Code
$('input').bind("keypress",function (e) {
if (e.which == 13) {
/**Append Logic **/
e.preventDefault();
}
});
JSFiddle
No comments :
Post a Comment