Ok.. so for each SSN1, SSN2 and SSN3 you will be having one button.. So do like this :
Button btn = e.Item.FindControl("yourbuttonid");
TextBox SSN1 = e.Item.FindControl("SSN1ID");
TextBox SSN2 = e.Item.FindControl("SSN2ID");
TextBox SSN3 = e.Item.FindControl("SSN3ID");
string script = "javascript:validate('" + SSN1.ClientId + "','" + SSN2.ClientId + "','" + SSN3.ClientId + "');";
btn.Attributes.Add("onclick", script);
Now in the page designer, place a script tag and add a function validate:
function validate(ssn1id, ssn2id, ssn3id){
var ssn1 = document.getElementById(ssn1id);
var ssn2 = document.getElementById(ssn2id);
var ssn3 = document.getElementById(ssn3id);
// do the logic here.
}
I home this is what you wanted. :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript