Print Page | Close Window

return value of msgbox

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=3083
Printed Date: 29 March 2026 at 9:42am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: return value of msgbox
Posted By: coolnlstuff
Subject: return value of msgbox
Date Posted: 28 May 2003 at 5:46am

I have a form and when submitted it will first check some values with VBScript.
Then a msgbox will pop-up asking to submit the form (Yes or No).

It is so that which button i click the form is always submitted.

I have the following sort of function:

FUNCTION MyForm_OnSubmit
  msgbox("Continue?"), 4
  MyForm_OnSubmit = TRUE
END FUNCTION

Now i want to submit the form when pressed YES in the message box and not when pressed NO in the messagebox. How do i do that?




Replies:
Posted By: coolnlstuff
Date Posted: 29 May 2003 at 5:52am

OK, with some experimenting and searching I figured it out.

I should do it like this:

FUNCTION MyForm_OnSubmit
  returnvalue = MsgBox("Continue"), 4
  IF returnvalue = 6 THEN
    MyForm_OnSubmit = TRUE
  ELSE
    MyForm_OnSubmit = FALSE
  END IF
END FUNCTION

I found some info at the following URL:

http://www.chilisoft.com/caspdoc/360docs/html/vbscript_msgbox_function.htm - http://www.chilisoft.com/caspdoc/360docs/html/vbscript_msgbox_function.htm




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net