Message Box

Cassio

Well-known member
Joined
Nov 30, 2002
Messages
276
Location
Rio de Janeiro
How do I retrieve a message box answer? I used this to pop up the message:
Code:
Response.Write("<script>confirm(Are you sure ....?);</script>")

Thanks
 
Store the value in a JavaScript variable that once filled, submits the page to itself along with the users response in either the query string or a form field.
 
Sorry, but I know nothing about JS, could you give me a example?
In this case the user can press OK or Cancel, how can I know if he presses ok? Could I put it in a invisible checkbox?

Thanks
 
Code:
<form id="hiddenForm" action="page.aspx" method="get">
    <input type="hidden" name="answer" id="answer" value="" />
</form>
Code:
<script language="JavaScript">
    var answer;
    answer = confirm(Are you sure ....?);
    document.all.hiddenForm.answer = answer;
    document.all.hiddenForm.submit();
</script>
Of course thats off the top of my head, so it might need some tweaking.
 
Back
Top