Ok Cancel button using javascript [modified]
-
Hi Experts, I have to show ok cancel button in popup and while clicking ok it should proceed and cancel should remain the same. Any idea, please provide. Modified : i need this is code behind.
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
modified on Monday, December 13, 2010 6:03 AM
-
Hi Experts, I have to show ok cancel button in popup and while clicking ok it should proceed and cancel should remain the same. Any idea, please provide. Modified : i need this is code behind.
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
modified on Monday, December 13, 2010 6:03 AM
Well, design your popup with two buttons... 'Ok' & 'Cancel'. Define OnClientClick event on both of them. Based on the button, different javascript event would be called. If it's a Cancel button then cancel the request, just return false. If it's an 'Ok' button, move on. There are lots of examples on the same. In case needed, just Google for 'Ok Cancel Javascript'
-
Hi Experts, I have to show ok cancel button in popup and while clicking ok it should proceed and cancel should remain the same. Any idea, please provide. Modified : i need this is code behind.
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
modified on Monday, December 13, 2010 6:03 AM
-
I am asking about code behind. I have few samples like btnImport.Attributes.Add("onclick", "javascript:return " + "confirm(Are you sure you want to create?')"); But this is not working.
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
I am asking about code behind. I have few samples like btnImport.Attributes.Add("onclick", "javascript:return " + "confirm(Are you sure you want to create?')"); But this is not working.
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
OK - you don't really need the "javascript:" bit, but apart from that, and the fact that you have missed out ther opening ' at the start of your message (before the word "Are"), it should work:
btnImport.Attributes.Add("onclick", "return confirm('Are you sure you want to create?')");