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
how to get the User's Time of Day
how to pass data between pages using Cookies
snippet to prevent submission of form when certain/any validations got failed
code to Hide and Show form controls
sample code to auto focusing the first field in a form
code to detect availability of cookies
Code to Block submission of form by pressing Enter Key
code to detect versions of different browsers like internet explorer, netscape, mozilla, opera etc
code to positioning of window in certain dimensions
Create a Menu that can be activated while clicking on Right Mouse button
code to images to rollover
write a code that user can choose/alter Body Text Size
How to encode and decode URL strings?
function to combine two or more arrays
How to block double clicks