Confirmation dialog box confirm, when we write the program often encounter before the user click to save the deletion of the prior to a confirmation dialog box, which can enhance the user experience can also prevent errors or not small delete action, to the user brought some convenience. This command is our confirm oh.
Confirm syntax
Confirm (Message)
Let's look at a couple of two simple examples.
<a href=# onclick= "javascript:confirm (' Are you sure you want to delete the record? ', ' del.php?id=1 ');
That way, when the user clicks, you're prompted, "Are you sure you want to delete the record?"
OK, let's look at a simpler example of confirm.
<script type= "Text/javascript" >
function Disp_confirm ()
{
var r=confirm ("Clicked on Me")
if (r==true)
{
document.write ("Success!")
}
Else
{
document.write ("Canceled!")
}
}
</script>
See the top of it.
<input Type=bottun onclick= "Javascript:return disp_confirm ();" >
This is when you click on the time there will be a confirmation box, the click is really prompted "success" is "Canceled"
Original site: www.111cn.net