I have a input field (type=text) on my page. I use Bootstrap and to style the field I use next html code:
<form fole="form">
<div class="form-group">
<input type="text" class="form-control" id="add-bookmark" value placeholder="Enter URL">
</div>
</form>
In the meteor application I have event handler:
Template.new_bookmark.events({
// add new bookmark
'keyup #add-bookmark' : function(e,t) {
console.log(e.which);
if(e.which === 13)
{
When I press any button in the input field I get the key code in the console (as I wish). But if I press the Enter-key the console log have nothing and my page is reloaded.
Looks like the reason of my problem is in the form-tag. If I remove it all works fine. What do I need to do ? Remove the form-tag or prevent the page will be reloaded when I hit the Enter-key ? How can I do it if the answer is second ?