I'm playing around in PHP, trying to make a simple calculator. I have made buttons that on click, add the value to the input field, like this;
The jQuery:
$('.symbols button').click(function() {
$('#advanced-sqrt').focus();
var value = $(this).text();
var input = $('#advanced-sqrt');
input.val(input.val() + value);
return false;
});
This somehow seem to unbind my enter key (on the keyboard) from submitting the form, and instead binding it to the first button, (
.
I've struggled with this issue for quite some time now, and haven't been able to see how this peace of jQuery would have anything to do with keybinding?
After going to Google for help, I saw some talk about return false;
, but removing it from my code does not seem to be an option (if I do so, my form submits every time I click a button)
Edit: To avoid confusion, I wish for 'Enter' to submit the form.