sdlangers Posted October 15, 2004 Posted October 15, 2004 hi, i need a different version of this code - all the examples i found are for prompting 'are you sure you want to delete?' btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete?');") and if ok is clicked, the server side function executes, and if cancel is clicked, it doesnt what i need is if ok is clicked server function 'A' is called and if cancel is clicked, server function 'B' is called - or alternatively, one funciton is called with a parameter that lets me know if the user clicked ok or cancel any ideas? Quote
Mothra Posted October 15, 2004 Posted October 15, 2004 Instead of useing the confirm dialog, you could use a simple small web page with your message and 2 buttons on it and open it as a Modal Dialog using javascript. The modal dialog would return a value and you can determine that value and take appropriate action. Quote Being smarter than you look is always better than looking smarter than you are.
sdlangers Posted October 15, 2004 Author Posted October 15, 2004 Thanks, but i was hoping there is an easier way - the confirm button does it - but i just cant trap the cancel - i thought there might be a way of sending the 'cancel' response back to the server side code and not just the 'ok' response Quote
Moderators Robby Posted October 15, 2004 Moderators Posted October 15, 2004 You can add the word "javascript:" before your "return" or btnDelete.Attributes("onclick") = "javascript:return " & _ "confirm(''Are you sure you want to delete?')" Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.