Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call Javascript Function from Textbox Change

Status
Not open for further replies.

nerdalert1

Programmer
Nov 4, 2004
92
US
How do I call javascript function called "messageuser" from the change event of a text box in ASP.Net
 
Is this what you were asking at the end of thread855-992425?

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
This is what I have so far in my code behind but its not working:

Dim sb As New StringBuilder

sb.Append("<script language=javascript>")
sb.Append("if (confirm('Your query returned over 1000 records. Do you want to proceed?')")
sb.Append("{")
test = "yes"
sb.Append("}")
sb.Append("else")
sb.Append("{")
test = "no"
sb.Append("}")
sb.Append("</script>")

If Not IsStartupScriptRegistered("ConfirmAlertHandler") Then
RegisterStartupScript("ConfirmAlertHandler", sb.ToString())
End If
 
Have you stepped through your code to find out why "it's not working"?

Also note that the page load event won't fire after your textbox changed event - if you step through your code you will notice it fires before.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Ya I am confused I think this might not work either. Maybe I just need to use straight javascript code. Calling on the exit of a textbox a function that prompts a confirm and if the user clicks yes then fill the txtbox(x).Text with the same values
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top