Results 1 to 9 of 9

Thread: Need Help With MsgBox Syntax

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63

    Question

    I know my syntax is incorrect just need to know if there is a simple way to do this. What I thought might work obviously didn't

    Any suggestions would be greatly appreciated.

    What I tried:
    ===================================
    <%
    IF NOT isempty(Request.Form("next")) then

    if request.form("storeid") = "999" then
    MsgBox "Incorrect Selection"
    response.redirect "./default.asp"
    else
    response.redirect "./clientadd.asp"
    end if

    end if
    %>
    ===================================


    Kind Regards,
    Hakan

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I do not believe you can use MsgBox in ASP.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63
    I did see this sniplet of code but it is not exactly what I am trying to do...

    <SCRIPT LANGUAGE="VBScript">
    Function MyForm_onSubmit
    MsgBox "Form was clicked"
    End Function
    </SCRIPT>

    <FORM METHOD="POST" ACTION="mypage.asp" NAME="MyForm">
    <INPUT TYPE="SUBMIT" NAME="btnSUBMIT" VALUE="Click Here">
    </FORM>


    I need the message box to come up when it corresponds to my if then statement in the previous post...

    Any ideas...

    Kind Regards,
    Hakan

  4. #4
    manishmenghani
    Guest
    Hey

    In the sniplet of code , it is using Client Side VB Script
    In which u can open a msg box while in your code u r trying to open a msgbox in Server Side Script that is not possible

    Got It ???

    Any queries left then ask //

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63
    Ok... no prob... is there any other way to do it??

    Kind Regards,
    Hakan

  6. #6
    manishmenghani
    Guest
    No ,I don't think so that there is any method by which u can ope a message box through server .
    I m not getting why u ever need this

  7. #7

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63
    The reason I want to do this is if an incorrect option is choosen out of the drop down I wanted it to pop a message box saying "Incorrect Selection".

    Thats about it...

  8. #8
    manishmenghani
    Guest
    u can do this by using Java Script on the previous page on which the combos are

    use the change event of combo box and write the necessary code for that

  9. #9
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Basically, you never want to open a modal dialog on the server (which is what MsgBox would do) cuz it is normally unattended so the web site would stop until someone clicked OK.

    What you want to do is use client side scripting and use window.alert()
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width