Click here to Skip to main content
11,716,938 members (87,068 online)
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 Sergey Alexandrovich Kryukov 634
1 Maciej Los 385
2 Richard MacCutchan 280
3 F-ES Sitecore 245
4 OriginalGriff 175
0 Sergey Alexandrovich Kryukov 1,029
1 Maciej Los 464
2 Richard MacCutchan 430
3 CHill60 415
4 OriginalGriff 415


Advertise | Privacy | Mobile
Web04 | 2.8.150901.1 | Last Updated 28 Dec 2012
Copyright © CodeProject, 1999-2015
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