Click here to Skip to main content
16,021,041 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i put this function:
JavaScript
<script type="text/javascript">
       function doConfirm() {
           return confirm('Are you sure you wish to continue?');
       }
   </script>

but how call it from the button?????
HTML
<input type="submit" value="Edit"/>
Posted
Updated 28-Dec-12 3:25am
v3

Hi,

Try this:
HTML
<input type="submit" value="Edit" onclick="doConfirm()" />

Hope this helps.
 
Share this answer
 
v2
Comments
loylmed 28-Dec-12 9:41am    
thank u.. :))
that there is no other way for the dialog to be more user-friendly???
Thomas Daniels 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?
If you are using ASP.Net button with id "Button1" then try adding this line in page load event:

C#
Button1.Attributes.Add("onclick","doConfirm();");
 
Share this answer
 
Comments
loylmed 28-Dec-12 9:40am    
thx...
that there is no other way for the dialog to be more user-friendly???
Zafar Sultan 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900