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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permission Denied MsgBox in vbscript 1

Status
Not open for further replies.

regiasp

Programmer
Feb 4, 2009
2
US
Hi,
I have this application which pulls up the data related to the search word in the database. But before searching i check the search word against any sql/javascript injections and redirect the user to the home page where the new search could be started if find any injections. So while redirecting to the homepage i send a value(say 1 or 2) and on the homepage i have written a script that compares this value against the stored value. If both are the same then i have to display a msgbox to the user saying "please enter only characters".Initially i tried checking the word and displaying msgbox at server side. But that gave an error "MsgBox Permission Denied". I understand that you can have pop ups at the server side and that is why i redirect the user to the homepage. I this case i tried displayin the msgbox with javascript alert which works fine. But if the user disables javascript on his browser then the alert box wont be produced. so I need a vbscript to do this job. Could any one help me this ? this is quite urgent
 
MsgBox is client side vbscript. You have to do use server side script like this:

<%
dim myMsg
myMsg = "HELP!"
Response.Write("<" & "script language=VBScript>")
Response.Write("MsgBox """ & myMsg & """<" & "/script>")
%>
 
Well, I have tried this code ! But it does not work. I do not even get any error for that. the simply loads without the pop-up. In fact, a similar javascript code works for me

Response.write("<script type=""text/javascript"">alert(""Only Characters allowed"");</script>")

But as i mentioned i want to use a vbscript and not javascript as it can be turned off on the browser.

Do i need to take care of something else too while running ur vbscript code ?
 
You are using FF aren't you? Sorry, FF doesn't support VBScript :(
 
i tested that code and it works. maybe you need to wrap some if statements arount it.
like this:

if your condition is ture then
myMsg = "HELP!"
Response.Write("<" & "script language=VBScript>")
Response.Write("MsgBox """ & myMsg & """<" & "/script>")
end if
 
Hey wvdba, I'm surprised! Mozilla says that FF doesn't VBScript or ActiveX at all. It's good to know. Thanks.
 
I replied before I test it. No, it doesn't work. :(
 
best bet is some CYA, javascript some confirmations works in most all clients, plus, server side validate if possible in case someone has JS turned off.

and if you absolutely must have a non-avoidable confirmation, make another page, post to it, that confirms, then post from it to end result.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never inside the 'loop' " - DreX 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top