?
Solved

confirm does not work with infragistics webimagebutton

Posted on 2006-06-07
6
Medium Priority
?
3,180 Views
Last Modified: 2009-08-21
Hi 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
0
Comment
Question by:Raju Srivatsavaye
6 Comments
 
LVL 25

Accepted Solution

by:
archrajan earned 510 total points
ID: 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();


}
0
 
LVL 33

Assisted Solution

by:knightEknight
knightEknight earned 495 total points
ID: 16857926
or you can do it in the <form> tag:

<FORM name="myform" action="myaction" onsubmit="return confirm('Are you sure?');" >
0
 
LVL 2

Assisted Solution

by:xlt77
xlt77 earned 495 total points
ID: 16857996
Confirm returns boolean value. Pressing ok button returns true, pressing cancel button or close the dialog directly returns false. so

function foo()
{
  if (confirm("your message"))
  {
    //Here do something
    return true
  }
  else
  {
    //Here do other things
    return false
  }
}

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Author Comment

by:Raju Srivatsavaye
ID: 16860903
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:foo()" />

<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
0
 
LVL 9

Author Comment

by:Raju Srivatsavaye
ID: 16861067
never mind,

dont think about the last post
i was wrong

<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="javascript:foo()" />
 should be

<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="javascript:return foo()" />
0
 
LVL 9

Author Comment

by:Raju Srivatsavaye
ID: 16861676
Hi guys,

I gave up and i am using a Image button (microsoft) instead of infragistics.
thanks for the help anyways

i ll split the points evenly between u three

Thanks
Raj
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question