@Html.TextBox("CategoryName", null, new { data_autocomplete_url = Url.Action("AutoComplete_Buyer"), @class = "textboxwdh200", id = "CategoryNameBuyer", maxlength = "30", onkeypress = "return isCharNumeric(this,event);" })
I am new to Jquery..can anyone help me to write code for when search button is clicked the focus should be at results occured..
i have written below one..
$(document).ready(function () {
$("#BuyerSubmit").click(function () {
debugger;
var Category = $('#CategoryNameBuyer').val();
url = 'business-buyer-leads?CategoryName=' + Category;
window.location = url;
$('#CategoryNameBuyer').focus();
});
});
But i am not getting the needed output..thanks in advance.
charan jallipalliPosted Sep 16, 2014, 1:08 AM
Ramesh MaruthiPosted Sep 15, 2014, 10:18 AM
@Html.TextBoxFor(k => k.EmailAddress, new { @class = "form-control", placeholder = "emailAddress", autofocus = "autofocus" })
charan jallipalliPosted Sep 15, 2014, 8:35 AM
Anubhav ChaudharyPosted Sep 15, 2014, 8:30 AM
You can try this:
document.getElementByID("CategoryNameBuyer").focus();
Let me know if this has worked for you or not