I want to use a java script code to insert a desired word in a TextBox
when an ImageButton
is clicked. The TextBox
may have some texts before inserting the desired word. I used the below VB.NET code and it works fine but I want to do it in the client seide. How is it possible? (I am new with java script)
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Dim emoticsign As String = TextBox2.Text & ":)"
ScriptManager.RegisterStartupScript(Me.Page, Me.Page.[GetType](), "myScript", "document.getElementById('" + TextBox2.ClientID & "').value = ' " & emoticsign & "';", True)
SetFocus(TextBox2)
End Sub