Results 1 to 2 of 2

Thread: Detect add mode

  1. #1
    iwui Guest

    Detect add mode


    How do you detect add mode?

    I need to display some text at the bottom of the page in add mode and do not want to show the text when the user click the cancel button and return to the grid.

    I can detect it using the followings:
    x = request("aspDBBut_" & DB_UNIT)
    x = UCASE(x)
    x = mid(x, 10, 3)
    If x = "ADD" Then

    It works when you when you click the "add new" button to get to the edit form.
    But as soon as you click the "add new record" button, aspdb returns to add mode form without any parameters (eg. aspDBBUT_200) in the URL, thus the code above will not work.



  2. #2
    John Guest

    Detect add mode (reply)

    Hi Iwui,

    You can tell if the user just pressed the "Add New Record" button, if the following form variable is set:

    Request("aspDBEditBut_1101&#34 (where 1101 is your dbUnitNo).

    So, just put an OR condition in there to see if the red "Add" button was just pressed, or if the "Add New Record" was pressed and you'll know if the user is in Add mode or not. Try adding this code to your program and you'll see it in action:

    response.write &#34;<BR>Add = [&#34; & request(&#34;aspDBEditBut_1101&#34 & &#34; ]<BR>&#34;

    Hope this helps,
    John


    ------------
    iwui at 2/28/2002 7:31:13 PM


    How do you detect add mode?

    I need to display some text at the bottom of the page in add mode and do not want to show the text when the user click the cancel button and return to the grid.

    I can detect it using the followings:
    x = request(&#34;aspDBBut_&#34; & DB_UNIT)
    x = UCASE(x)
    x = mid(x, 10, 3)
    If x = &#34;ADD&#34; Then

    It works when you when you click the &#34;add new&#34; button to get to the edit form.
    But as soon as you click the &#34;add new record&#34; button, aspdb returns to add mode form without any parameters (eg. aspDBBUT_200) in the URL, thus the code above will not work.



Posting Permissions

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