Problem when press 'Enter key' on 'Textbox' [Resolved]

Posted by Muhsinathk under C# on 9/14/2012 | Points: 10 | Views : 1774 | Status : [Member] | Replies : 5
Hi,
When i press on Enter key on Textbox,it will shows some validation.
I want code for directing Enter key to Save button.




Responses

Posted by: Muhsinathk on: 9/14/2012 [Member] Bronze | Points: 25

Up
0
Down

Resolved
I got Answer with this code..Please try this if any one has same problem

$('input').keyup(function (e) {
if (e.keyCode == 13) {
$('#Button_id').click();
return false;
}
});

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 9/14/2012 [Member] Starter | Points: 25

Up
0
Down
did you write any code for textbox validation?

Thanks & Regards
Hari

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/14/2012 [Member] Bronze | Points: 25

Up
0
Down
Yes.I wrote some Jquery validation for textbox.

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 9/14/2012 [Member] Starter | Points: 25

Up
0
Down
can u post here?

Thanks & Regards
Hari

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/14/2012 [Member] Bronze | Points: 25

Up
0
Down
$(".DetailsTextValidation").each(function () {
var values = this;
if (values .id != '') {
if ($.trim($('#' + values .id).val()) == '') {
var ErrorMsg = $('#' + values .id).attr('data-val-required');
if (typeof ErrorMsg != 'undefined') {
$("#ErrorMessagesDiv").append(ErrorMsg + '<br />');
result = false;
}
}
}
});

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response