I am working with this code here:
What I am trying to do is trigger the "Add" button of the specific line when the input field in this line is focused and the enter button is hit.
As far as I can guess it's something a bit like this:
$("#current").keyup(function(e) { if(e.keyCode == 13) { $("#add").submit(); } }); I've tried to get a few different things working but this is almost the first code I have written in Javascript and I'm getting a little bit stuck. Could anyone show me where I am going wrong?
#currentevents. This is invalid and won't work as you expect.idattributes must be unique.add:)$(document).ready(function() { $("#add").focus(); })