nikola_mk
asked on
php yes no message box
Hi
Can some one tell me how to display yes no message box in php coded like code below
message box can be javascript
Thanks
Can some one tell me how to display yes no message box in php coded like code below
message box can be javascript
Thanks
if(isset($_GET["action"])) {
switch ($_GET["action"]) {
case "del":
//here message box "are you want to delete?" and if user click "yes" echo"Delete" if click "no" echo "No Delete"
break;
case "edit":
//here same message box for edit
break;
}
>>if(isset($_GET["action"] ))
Somewhere else you probably have a link or a button. It is THERE that you need to do this, NOT on the php code you are pointing out:
<a href='#' onclick='retrun confirm("Are you sure you want to delete this item?") '>Delete</a>
Somewhere else you probably have a link or a button. It is THERE that you need to do this, NOT on the php code you are pointing out:
<a href='#' onclick='retrun confirm("Are you sure you want to delete this item?") '>Delete</a>
In VBScript ( which will only work in Explorer ) you can try this:
<script language="VBScript">
Dim intAnswer
intAnswer = MsgBox("do you want only YES and NO?", vbYesNoCancel)
If intAnswer = 6 Then
' Yes.
ElseIf intanswer = 7 Then
' No
Else
' Cancel
End If
</script>
Else, you can try to create a modal javascript box to encompass this.
<script language="VBScript">
Dim intAnswer
intAnswer = MsgBox("do you want only YES and NO?", vbYesNoCancel)
If intAnswer = 6 Then
' Yes.
ElseIf intanswer = 7 Then
' No
Else
' Cancel
End If
</script>
Else, you can try to create a modal javascript box to encompass this.
ASKER
I use this code but message box did not appear
<td> <a href='?action=del' onCLick='return confirm('Are you SURE you want to delete this record?')'> <img alt='del' src='delete_cell.jpg' title='del' /> </a>
where I'm wrong?
thanks
<td> <a href='?action=del' onCLick='return confirm('Are you SURE you want to delete this record?')'> <img alt='del' src='delete_cell.jpg' title='del' /> </a>
where I'm wrong?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if (confirm(message)){
submit_request;
} else {
do_nothing;
}