Tuesday, December 4, 2007

How to add a form to Struturo

Submitting forms to other existing Domino databases

Many of our customers have existing Lotus Notes databases with Web forms for submission. They want to put those forms into Struturo. Here's how to do it.

Overall Approach

The basic approach is to just take the form tags and inputs and put them into a page which will just submit to the current location.

One fairly easy way to do this is to just open the existing form on the web, view the source code, and copy everything from the beginning form tag to the ending form tag and paste it into a page. I say fairly easy because you might have to strip now a lot of the extra information that Domino passes through including font tags and breaks and keyword refreshes. You can add any JavaScript that you need such as for validation or showing and hiding fields using traditional JavaScript methods which I won't cover in this article.

Real World Example

So here we have a traditional Domino Web form for contacting this company.

Original Submission Form

Copy source and paste into a new page (as HTML)

Original Source Code

Customize form tag

You will also have to customize the beginning form tag to do a create document. See the screenshot for details but make sure the action points to the full URL including http and also set the action to create document. FYI - Javascript is disabled at the database level in Struturo.

New form tag

Clean-up the HTML

Remove any font tags, put ending slashes on input tags and break tags, remove table widths, remove table borders unless you want them, remove keyword refreshes. Our goal is to represent the actions and the look and feel using style sheets and JavaScript, not in-line HTML as Domino typically spits out.

Add a submit button

Because we have disabled JavaScript in a database properties, there is no need to complete Domino's inherent form tag because it won't exist in this scenario. Therefore in most cases you can put a simple submit button at the bottom of your page content.

Submit HTML

Modify the $$Return value in the original Domino database to point to a thank you page in Struturo

The thank you page is just a standard page that you would create in Struturo. Simply point to the URL of that page using standard $$Return from the original Notes database.

Add in any Javascript validation as you need

For simplicity, not discussing how to do that in this article. Contact us for support if you need it.

That's it

Your form should submit as usual to the original Notes database you had that collected this form in the first place.

struturo box

Live Online Demo Free

We are happy to give you and your team a live demo. Submit a request and we will coordinate a time that works best for you.