View Single Post
  #1 (permalink)  
Old Nov 7th, 2005, 16:07
bwalker bwalker is offline
New Member
Join Date: Nov 2005
Age: 39
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Access a HTML InputBox through the Code-Page

I have a HTML control Inputbox:
<INPUT type="text" onkeyup="chkText(tester.value)" id="tester">

I want to access it through my codepage when I press a button


PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim strMessage As HtmlInputText
strMessage =
Me.tester
Dim strScript AsString = "<script language=JavaScript>alert('" & strMessage.Value & "');</script>"
If (Not Page.IsStartupScriptRegistered("clientScript")) Then
Page.RegisterStartupScript("clientScript", strScript)
EndIf

EndSub

the error I get is:
Object reference not set to an instance of an object.

I want to keep the textbox client side validation because I check on every keyup. Is there any way to grab the text from the inputbox and use.

Thanks
Bob
Reply With Quote