logo

Common fields subform.


One of the first things I do when starting a new database for the web is to create a subform called "CommonFields" which I will use on every form in the database. On it I usually put all the fields that I find myself using in just about every form.

By useful fields I mean things like:

  • DBPath
    • Computed For Display Text
    • @ReplaceSubstring(@Subset(@DBName; -1); "\\"; "/");
    • Used in all URLs whose relative position is unknown
  • isAdmin
    • Computed For Display Text
    • @UserRoles = "[Admin]"
    • Boolean value of whether or not user has Admin role. Useful in hide-whens.
  • CGI Variables
    • Computed For Display Text
    • Formula same as name
    • Examples - HTTP_Referer, Query_String, Remote_User

You can also add any Global JavaScript Functions/Variables that you need to throughout the site. If using R5 these can go in the JSHeader, otherwise add them as Pass-Thru HTML straight on to the subform.

Feedback

  1. How to paste the URL in SendMail Agent

    How do we paste the URL Link of the current Web Document in the Web SendMail Agent? What kind of fields we should create in the form to achieve that goal?

  2. Server Name does not show with @DbName formula

    I created a computed field called Server but Server Name does not show with @DbName formula on the Web. It only shows in the Notes client. Can someone help me on this?

      • avatar
      • Stan Rogers
      • Thu 2 Jan 2003

      Re: Server Name does not show with @DbName formula

      That's done on purpose, since remote lookups, etc., are not permitted on the web. Anything other than an empty string ("") specified in a ServerName parameter on the web will result in a security error. Given that, it is difficult to understand what purpose the server name could serve in a web application.

      Show the rest of this thread

    1. Re: Server Name does not show with @DbName formula

      You can directly use following : Field Name : SERVER_NAME Type : Computed for Display Value : SERVER_NAME

      This will return you the server name on which your database resides.

      -Darshana

    2. Re: Server Name does not show with @DbName formula

      @GetHTTPHeader("Host")

      Show the rest of this thread

  3. Dynamic First Field

    I have been tasked with creating a template that not matter what the name of the field, when loaded via a browser, it will automagically go to the first field.

    I use the "onLoad": document.forms[0].elements[0].focus()

    For whatever reason, this won't recognize the first field.

    If I use "onLoad": document.forms[0].first.focus() and name the field "first" it works fine.

    I prefer using the elements[0] method so I don't have to dictate field names. This is a basic template that will be used to make custom forms. Because of all the other elements required, I am using a subform to store the input fields.

    Any thoughts as to why this isn't working?

      • avatar
      • Jake
      • Sun 2 May 2004

      Re: Dynamic First Field

      Hi Kurt,

      Not sure why it wouldn't work. Depends what the first element is. May not be a field! Try:

      alert(document.forms[0].elements[0].name)

      and see what it thinks element 1 is.

      Show the rest of this thread

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:



Navigate other articles in the category "Forms"

« Previous Article Next Article »
Creating response documents in the browser   Create a 'Delete Document' link

About This Article

Author: Jake Howlett
Category: Forms
Keywords: CGI variables; path; file;

Options

Feedback
Print Friendly

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »