Click here to Skip to main content
15,887,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i add javascript validation to Textbox in GridView item template column.....plz tel me any one its very urgent...
Posted
Comments
Karthik_Mahalingam 17-Dec-13 5:02am    
which validation, you want to add ??
TrushnaK 17-Dec-13 5:04am    
post your code what you done so far.

You can assign javascript to textbox on RowDataBound
TextBoxName.Attributes.Add("onkeyup", "checkvendor()");
 
Share this answer
 
you can also use "onKeyPress" event to call javascript funtion.like below

<asp:textbox id="txtName" runat="server" onkeypress="validate(this);" xmlns:asp="#unknown">

funtion validate(e){
if(e.value == ""){
alert("Name is required.");
}
}
 
Share this answer
 
not working above two solutions
 
Share this answer
 
Comments
Karthik_Mahalingam 17-Dec-13 5:02am    
Please use Have a Question or Comment? button to post queries or comments on solutions, Dont use Solution to ask queries.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900