Sandy,
ontextchanged is a server-side event. You need the client side onchange one.
That is:
<asp:textbox id=txtUserName onchange="onchange();" runat="server"
Width="100%"></asp:textbox>
vb code is on the server side. Your task is a client-side one. In ASP.NET
You need to have clear understanding what belongs to server and what to
client.
Eliyahu
"Sandy" <Sa***@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
Hi Eliyahu!
Thanks for your response. I am having trouble hooking it up. I put the
script in the html and tried:
<asp:textbox id=txtUserName ontextchanged="onchange" runat="server"
Width="100%"></asp:textbox>
I need to connect it with something in the vb code though, don't I?
--
Sandy
"Eliyahu Goldin" wrote:
Sandy,
Setup a client side onchange event for the textbox. In the event check
if the textbox is empty and hide the label.
The javascript event handler will look like this:
function onchange(){
if (myTextBox.value == "") myLabel.style.display="hidden";}
Eliyahu
"Sandy" <Sa***@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com... Hello -
I have a page that runs a stored procedure checking for the existence
of a name in a database. If it exists, lblMessage returns text indicating
same.
When a user goes back and clears the textbox, I would like the message
to disappear, instead of waiting for a return trip to the server.
Any suggestions will be greatly appreciated!
--
Sandy