Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another msgbox question 1

Status
Not open for further replies.

MillsRJ

Technical User
Sep 14, 2002
28
0
0
CA
I have the following code on an asp page. the form parameters are passed from another pages submit function

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>

<!--#include file=&quot;Connections/OTReporting.asp&quot; -->
<% Response.Buffer = True %>
<!--#include file=&quot;inc_top_img.asp&quot; -->
<% if session(&quot;LoggedIn&quot;) then %>

<%
dim x
if request.form(&quot;subcategoryselect&quot;)=0 then
response.redirect(&quot;dataentry.asp?entryerr=1&quot;)
end if
if request.form(&quot;datebox&quot;) = &quot;&quot; then
response.redirect(&quot;dataentry.asp?entryerr=2&quot;)
end if
if datediff(&quot;d&quot;,Now,request.form(&quot;datebox&quot;)) > 0 then
response.redirect(&quot;dataentry.asp?entryerr=3&quot;)
end if
%>

problem is that I want to add a msgbox function in front of each response.redirect, obviously I'm having no luck (otherwise why would I ask?)

I've tried putting
<script language=&quot;vbscript&quot;>
msgbox &quot;you chose the wrong button&quot;
</script>

but it doesn't work, any ideas?

thanks


Rob Mills
System Analyst
Correctional Services Canada
(all statements are my own and do not reflect on my employer)
 
faq333-3048
reference 2

_____________________________________________________________________
[sub]You can accomplish anything in life, provided that you do not mind who gets credit.
Harry S. Truman[/sub]
onpnt2.gif

 
Here's a trick I use:
<%
dim x
if request.form(&quot;subcategoryselect&quot;)=0 then
%>

<form name=&quot;frmTest&quot; action=&quot;dataentry.asp?entryerr=1&quot; method=&quot;post&quot;>
<script language=&quot;VBScript&quot;>
iResponse = msgbox(&quot;Are you sure that you want to go to Data Entry?&quot;,4,&quot;Verify Submission&quot;)
if iResponse = vbno then
window.event.returnvalue=false
Else
frmTest.Submit()
end if

</script>
</form>
<%
End IF
%>
 
I can tell you must be in a intranet setting with IE only browsers. right Veep?

_____________________________________________________________________
[sub]You can accomplish anything in life, provided that you do not mind who gets credit.
Harry S. Truman[/sub]
onpnt2.gif

 
How'd ya guess? [lol] 99.9% of my answers in VBScript have anything to do with it? [laughtears]

It's like second nature and always right on the tip of my toungue. Probably like JavaScript is for you. When I think JavaScript solution, I actually have to think [sad].
 
I see, so you use a form (an HTML tag) to do the function of the respons.redirect.

awsome, thank you

Rob
 
does the line at the top

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>

have any bearing on what I'm trying to do?

thanks



Rob Mills
System Analyst
Correctional Services Canada
(all statements are my own ...., ah hell, its the government, sue'em anyway)
 
MillsRJ
the language spec does not have any further bearing on the page then specifying what langauge you are developing the ASP in.

note: Veep's and my discussion was in that the scripts will only work via IE. If that is fine then please, next time let us know that and things will become much more clear and easier to guide on. [smile]

_____________________________________________________________________
[sub]You can accomplish anything in life, provided that you do not mind who gets credit.
Harry S. Truman[/sub]
onpnt2.gif

 
It works great, thanks again

and yes, it is an intranet with IE6 everywhere


Rob Mills
System Analyst
Correctional Services Canada
(all statements are my own ...., ah hell, its the government, sue'em anyway)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top