Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
i put this function:
 <script type="text/javascript"> 
        function doConfirm() {            
            return confirm('Are you sure you wish to continue?');
        } 
    </script>
but how call it from the button?????
<input type="submit" value="Edit"/>
Posted 28-Dec-12 2:58am
loylmed374
Edited 28-Dec-12 3:25am
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
Try this:
<input type="submit" value="Edit" onclick="doConfirm()" />
Hope this helps.
  Permalink  
v2
Comments
loylmed at 28-Dec-12 9:41am
   
thank u.. :))
that there is no other way for the dialog to be more user-friendly???
ProgramFOX at 28-Dec-12 9:42am
   
thank u
You're welcome!
that there is no other way for the dialog to be more user-friendly???
What do you mean exactly?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you are using ASP.Net button with id "Button1" then try adding this line in page load event:
 
Button1.Attributes.Add("onclick","doConfirm();");
  Permalink  
Comments
loylmed at 28-Dec-12 9:40am
   
thx...
that there is no other way for the dialog to be more user-friendly???
Zafar Sultan at 28-Dec-12 9:45am
   
You can try jquery confirmation box. Search google for it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 751
1 George Jonsson 330
2 Garth J Lancaster 290
3 Sergey Alexandrovich Kryukov 274
4 BillWoodruff 252
0 Sergey Alexandrovich Kryukov 10,879
1 OriginalGriff 5,555
2 Maciej Los 5,534
3 CPallini 3,819
4 BillWoodruff 3,594


Advertise | Privacy | Mobile
Web04 | 2.8.141030.1 | Last Updated 28 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100