This topic is locked

Message box to run an event

5/22/2007 6:31:13 PM
ASPRunnerPro General questions
F
fnqchick author

Hi There,
I use the message box code below for users to quickly move between screens.
Response.Write "<script> if(confirm('Would you like to add an expense item now?')) window.location='tblExpItems_add.asp'; else window.location='tblExpClaim_List.asp';</script>"
I have an after edit event that sends approval emails out to managers. If the user is just making a change or adding an uploaded document sometimes an approval email is not necessary and the managers just get bombarded with useless emails. Is there a way to have a message box that asks the user whether an email should be sent after the edit or not?
This would mean that if the user selects 'Yes' the afteredit event runs or if the user selects 'No' it doesn't.
Thanks for your time.

Sergey Kornilov admin 5/25/2007

Unfortunately it's doesn't work this way.
ASP code is executed on the server.

Javascript code is executed in web browser on th client side. You can make Javascript code talk to server-side code.
You can add a field to the Add form with this question and depending on users choice send an email in AfterEdit event.