
Mixing of client-side and server-side scripts
Quote:
> Thanks for the replies to my last question.
> I have another question. Is it possible to put server-side
> script like the example below? Or if there is any better
> methods to do the same job with the same results? Thanks
> again.
> MK
> <script language = "vbscript">
> dim result
> sub cmdClick_OnClick()
> result = msgbox("Are you sure you want to
> update?",vbYesNo)
> if result = vbYes then
> <% response.redirect "update.asp" %>
> else
> <% response.redirect "abort.asp" %>
> end if
> end sub
> </script>
Hi!
Yes, i think that a better way to do that it's putting the update and de
abort code at the beggining of the some procedure code, wich it's called
recursively. But you need to recover this parameters with a
querystring("action") (for example)... where "action" it's the action you
want.
F.Ex:
Quote:
> sub cmdClick_OnClick()
> result = msgbox("Are you sure you want to
> update?",vbYesNo)
> if result = vbYes then
> window.navigate("thesameroutine.asp?action=update")
> else
> window.navigate("thesameroutine.asp?action=abort")
> end if
> end sub
> </script>
In the head of your routine:
<%
if request.querystring("action")="update"
'do something
End
if request.querystring("action")="abort"
'do something
End
%>
Regards.......... Gabriel.