Reputation: 1
I have pass Id of text box contol and want to retrive value..
function GetTextval(id)
{var value = $('#<%=' + id + '.ClientID %>').val();
alert(value);
}
Upvotes: 0
Views: 747
Reputation: 28588
You cannot call clientId on client-sided variable, you need to pass parameter to function in a way that it is already converted to client id:
function GetTextval(id){
var value = $('#'+id).val();
alert(value);
}
and on calling function:
GetTextval(this.id);
or
GetTextval(<%= ControlId.ClientID %>);
Upvotes: 1