or you can do it in the <form> tag:
<FORM name="myform" action="myaction" onsubmit="return confirm('Are you sure?');" >
Main Topics
Browse All TopicsHi experts,
I am wotking on infragistics webimagebutton, and i need to have a comfirm dialog box on that button.
It have used a function foo() to the clientsideevents.click
In that function i have a some code from which i get the message that has to be shown in the confirm dialog box. At the end of the function, i used this code
return confirm(strReturn)
--strReturn is my message
when i click the button, i get the confirmation box but it postbacks even if cancel is clicked.
Is it something to do with the infragistics??
One more thing, webimagebutton has a property called "AutoSubmit". I tried setting that to false.
If i do that, my confirm box pops up many number of times (6 i think) and even if i click ok, it never submits the page.
Could somebody help me out please?
Regards
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi guys,
Now forget about the infragistics. I was just testing using a normal ASP.NET 2.0 button
This code works
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return confirm('Do you really want to delete this row? No undo action is available')" />
but when i use the code below, i am getting the confirm dialog box but even if i click cancel the form is getting submitted.
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="javascript:
<script type="text/javascript">
function foo()
{
return confirm('Do you really want to delete this row? No undo action is available')
}
</script>
Do you know what is the difference?
Raj
Business Accounts
Answer for Membership
by: archrajanPosted on 2006-06-07 at 16:37:37ID: 16857635
try to make the image a non submit button
;
something like this
<img src = "abc.gif" onclick = "dosub();">
function dosub()
{
if(confirm("your message"))
document.formname.submit()
}