Hello,
I want to simulate a couple of clicks. A 'Save' and 'Cancel' anchor clicks.
I have this as my enter simulation
$('.group').live('keypress', function(e){
code = e.keyCode ? e.keyCode : e.which;
if(code.toString() == 13){
$(this).find('a.saveChanges').click();
}
});
and this as my esc simulation
$('.group').live('keypress', function(e){
code = e.keyCode ? e.keyCode : e.which;
if(code.toString() == 0){
$(this).find('a.discardChanges').click(function(){
GROUP.find('.group-text')
.text(GROUP.data('origText'))
.end().removeData('origText');
GROUP.find('.groupcount').fadeIn('slow');
GROUP.find('.group-image').fadeIn('slow');
GROUP.removeClass('editmode');
});
}
});
My enter seems to work perfect, but my esc doesn't. I'm running this in Firefox at the moment.