Hi,
I have a message box javascript that determains what button the user clicks and returns certain messages based on that chocie. I also have asp script within the javascript logic that needs to run base on the choice, however the asp seems to run regardless of the button choice. Here is the code:
<script type="text/javascript">
var answer = confirm ("Do You Want To Remove <%=rs"prodname")%>?")
if (answer)
alert ("<%=rs("prodname")%> Removed, Thank You.")
<%strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database/products.mdb")
Set objConn2 = Server.CreateObject("ADODB.Connection")
objConn2.open strConnect
sql = "update products set remove = true where prodid = " & remove
Set rs2 = objConn.execute(sql)%>
else
alert ("<%=rs("prodname")%> Not Removed.")
</script>
Basicly what is suppose to happen is if the user clicks 'yes' to the message box they with get the "Product Removed" message and the sql script will run, if they click no the "Not removed" Message will run but not the script, however the script runs regardless of the button clicked even though the message boxes will display the proper message. Any help on this would be appericated.
Thanks in advance.
I have a message box javascript that determains what button the user clicks and returns certain messages based on that chocie. I also have asp script within the javascript logic that needs to run base on the choice, however the asp seems to run regardless of the button choice. Here is the code:
<script type="text/javascript">
var answer = confirm ("Do You Want To Remove <%=rs"prodname")%>?")
if (answer)
alert ("<%=rs("prodname")%> Removed, Thank You.")
<%strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database/products.mdb")
Set objConn2 = Server.CreateObject("ADODB.Connection")
objConn2.open strConnect
sql = "update products set remove = true where prodid = " & remove
Set rs2 = objConn.execute(sql)%>
else
alert ("<%=rs("prodname")%> Not Removed.")
</script>
Basicly what is suppose to happen is if the user clicks 'yes' to the message box they with get the "Product Removed" message and the sql script will run, if they click no the "Not removed" Message will run but not the script, however the script runs regardless of the button clicked even though the message boxes will display the proper message. Any help on this would be appericated.
Thanks in advance.