I\'m trying to make it so when a user is in a text box and they press enter, it is the same as clicking the link, in which case it should take them to another page. Here\'s what
I used the following with asp.net LinkButton
$('#drivingSchoolInput').keypress(function (event) {
if (event.keyCode == 13) {
eval($('#button1').attr('href'));
}
});
I also had a FORM on the header with allowed for seaching, so I need to add another step to disable the FORM from posting.
$('#drivingSchoolInput').keypress(function (event) {
if (event.keyCode == 13) {
$('#header1_ButtonTerm').attr('disabled', 'disabled'); <-- hack added to kill FORM POST
eval($('#button1').attr('href'));
}
});