Results 1 to 3 of 3

Thread: Default value in the edit mode

  1. #1
    raymond chou Guest

    Default value in the edit mode


    I need to pass a session variable to the default value in the edit mode. The session variable contains a user name that will be autmatically stamped in the record similar to the date stamp feature. Is there a way to do that?



  2. #2
    John Guest

    Default value in the edit mode (reply)

    Hi Raymond,

    As you can see from the example: "B8" at: http://www.aspdb.com/examples/aspdbexb08.asp, you can enter
    default values into the forms in edit (ADD) mode.

    In reading the code (or the online manual), you'll see that dbEditFlds let's you specify which fields you wish
    to have on the edit form, and what their default values are (follow the field name with brackets and the default
    value). For example:

    X.dbEditFlds = "FirstName[John Doe]"

    Would show the first name field with a default value of "John Doe" in it.

    Your question is how do you put a session variable into the default value. That's just simple ASP. Let's
    say that the session variable is called Session("myName&#34. To put that into the edit field, you'd use:

    X.dbEditFlds = "FirstName[" & Session("myName&#34 & "]"

    That's all there is to it.

    Hope this helps,
    John


    ------------
    raymond chou at 8/13/99 6:44:03 PM


    I need to pass a session variable to the default value in the edit mode. The session variable contains a user name that will be autmatically stamped in the record similar to the date stamp feature. Is there a way to do that?



  3. #3
    raymond chou Guest

    Default value in the edit mode (reply)

    It works. Thanks.

    Here is the code that I use.

    Session("UserID&#34 = Request.ServerVariables.Item("Logon_User&#34
    ' capture NT user account.
    Mydb.dbEditFlds = "(;|)|UserID["& session("UserID&#34 &"]"
    '



    ------------
    raymond chou at 8/13/99 6:44:03 PM


    I need to pass a session variable to the default value in the edit mode. The session variable contains a user name that will be autmatically stamped in the record similar to the date stamp feature. Is there a way to do that?



Posting Permissions

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