Confirmation Messagebox
Hi,
this is ibrahim,n im new to this site, joined recently, guys im developing a web site in asp, n got stuck, n im pasting the code below with my problem....
This is my page containing the selected staff details for edit....
-------------------------------------------------------------------
<form method="post" action="update_staff.asp">
<table bgcolor="#b0c4de" border=0 >
<tr>
<thead><input type="hidden" name="name1" value="<%=nm%>"></thead>
<th colspan=2 name="name" align="middle"><%=nm%></th>
</tr><tr>
<td>Telephone #</td>
<td><input type=text name="tel" value="<%=tel%>"></td>
</tr><tr>
<td>Ext #</td>
<td><input type=text name="ext" value="<%=ext%>"></td>
</tr><tr>
<td>Res #</td>
<td><input type=text name="res" value="<%=res%>"></td>
</tr><tr>
<td>GSM #</td>
<td><input type=text name="gsm" value="<%=gsm%>"></td>
</tr><tr>
<td>Email</td>
<td><input type=text name="email" value="<%=email%>"></td>
</tr><tr>
<td>Department</td>
<td><input type=text name="dept" value="<%=dept%>"></td>
<%
rs1.close
conn.close
%>
</tr>
</table>
<br />
<input type="submit" name="action" value="Update" onclick="Call_onclick()">
<input type="submit" name="action" value="Delete">
</td>
</tr>
</table>
</form>
-------------------------------------------------------------------
This this is page for actual updateing the record.....
<%
if nm1="" then
response.redirect "staff-cont-edit.asp"
response.end
END IF
on error resume next
set rs =server.createobject("adodb.recordset")
if Request.form("action")="Save" or Request.form("action")="Update" then
sql="UPDATE staff_cont SET tel=" & Request.Form("tel") & ","
sql=sql & "ext=" & Request.Form("ext") & ","
sql=sql & "res=" & Request.Form("res") & ","
sql=sql & "gsm=" & Request.Form("gsm") & ","
sql=sql & "email='" & Request.Form("email") & "',"
sql=sql & "dept='" & Request.Form("dept") & "' WHERE name='" & nm1 &"';"
conn.Execute sql
' conn.Execute sql,Recordsaffected
Response.write "<center>Updating..."
Response.write "<br>"
Response.write "<img src=""images/loading2.gif"" align=""center""></center>"
elseif Request.Form("action")="Delete" then
nm1=Request.Form("name1")
sql="DELETE FROM staff_cont WHERE name='" & nm1 &"'"
conn.Execute sql
conn.Execute sql,Recordsaffected
if err > 0 then
Response.Write("You do not have permission to delete a record from this database!")
else
Response.Write("Record " & nm1 & " was deleted.")
end if
Response.Write("Deleting records has been disabled from this demo")
end if
conn.close
set conn=nothing
%>
-------------------------------------------------------------
Now the problem is i want to have a confirmation messagebox so before posting the record i want the user choose yes/no for additing the if it is yes then only it should update the record, n if is no then i should cancel the action.... plz help me out dear....
with millions of thanks in advance
with regards
sm ibrahim
With Regards
sm ibrahim
|