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


Please Help Members By Posting Answers For Below Questions

communication between main window and new windows

1705


code to get the coordinates of a Click Event

1742


how to pass data between pages using Frames

2149


function to combine two or more arrays

1707


code to images to rollover

1860






code to create a new window

1754


how to Scroll a DIV content

2161


how to convert between arrays and strings

2115


Reading which Non-Character Key was pressed

1693


code to positioning of window in certain dimensions

1669


how to create Expandable and Collapsible Menus

2656


create Drop-Down Navigation Menus

1706


advance the focus to next consecutive fields when Enter Key is pressed

1798


write a code that user can choose/alter Body Text Size

1610


code to Hide and Show form controls

1810