Hello
I have a FormView wich is used to submit comments. I have added an extra attribute to the TextBox were the comment is written, so that when i have focus on the TextBox and press Enter i activate the Insert button. The problem is that it allways inserts twice, leaving 2 identical comments in the database.
Code:
Dim b As LinkButton = ComField.Controls.Item(0).FindControl("InsertButton")
Dim txtb As TextBox = ComField.Controls.Item(0).FindControl("Comment1TextBox")
txtb.Attributes.Add("OnKeyDown", "javascript:if (event.keyCode == 13) __doPostBack('" + b.UniqueID + "','')")
I am really new with JavaScript so i need some help to deactivate the key before i run the code, or something like that.