Code for Adding Message and Confirmation Boxes Using
JavaScript?
Answer Posted / sivasubramanian.k
<html>
<head>
<script>
function message()
{
var str;
str="Click Ok to continue!!!";
alert(str);
}
function confirmation()
{
var str;
str="Are you sure to delete?Then click Ok or Cancel!!!";
confirm(str);
}
</script>
</head>
<body>
<form>
<h3>Click the button below which shows message box</h3>
<input type="submit" value="Click Me" name="submit"
onClick="return message()">
<h3>Click the button below which shows confirmation box</h3>
<input type="submit" value="Delete" name="delete"
onClick="return confirmation()">
</form>
</body>
</html>
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
sample code to auto focusing the first field in a form
how to convert between arrays and strings
advance the focus to next consecutive fields when Enter Key is pressed
program to bring a window to the front
write a code that user can choose/alter Body Text Size
maximizing the main window
code to positioning of window in certain dimensions
create Drop-Down Navigation Menus
write a code to generate pseudorandom numbes
how to create a Draggable element
how to pass data between pages using Frames
code to detect availability of cookies
How to block double clicks
how to copy form data between different pages
code to create a new window