Question How To Display A Prompt Box?

DAPOOLE

Registered User.
Local time
Today, 18:10
Joined
Jan 14, 2010
Messages
38
How can I code a user prompt box to display when a command button is pressed? Basically I want the user to confirm that they want to delete a record when they press the delete record command button.

Thanks in advance.
 
On the OnClick event of the command button

Code:
If MsgBox("Are you sure you want to delete this record?",vbQuestion+vbYesNo,"Confirmation") = vbYes Then
    'delete the records
Else
   Exit Sub
End If

David
 
<html>
<head>
<script type="text/javascript">
function disp_prompt(){
var name=prompt("Name","")
if (name!=null && name!=""){
document.write(name)
}
}
</script>
</head>
<body>
<form>
<input type="button" onclick="disp_prompt()" value="Display a prompt box">
</form>
</body>
</html>
 

Users who are viewing this thread

Back
Top Bottom