Creating a document from HTML Form

Hi

I am new to domino. I want to collect user information from html form on website and then save this information in domino document. How can I achieve this.

I have read in a book that we can call agents directly through .Then this agent can be used to collect information from the html form and storing this information in a document.

Please help me how can I achieve this. Which language should I preffer to write agents.

Regards

Jitendra Sachdeva

Subject: Creating a document from HTML Form

Does this have to be done with an “HTML form”. The easiest way to achieve what you want is to use the native Domino facilities.

i.e. create your form using a normal Form in designer. Display it on the web using a ?OpenForm url. Have an action button on the form that has @command([FileSave]);@command([FileCloseWindow]);

When you click on the action button on the web, the document will automatically be created. If you need to change the values on the document, or manipulate the form used, then create a WebQuerySave agent. Most webby agents are written in LotusScript or Java. Which to choose depends on what you are most familiar with, and if you need to use external Java classes etc.

HTH - Rufus.

Subject: RE: Creating a document from HTML Form

Thanks Rufus for your response to my query. I want to use HTML form as I can comfortably edit fields and looks in HTML.

Subject: RE: Creating a document from HTML Form

While I understand that you are comfortable with HTML forms, you are going to make your life very difficult if you try to use such forms with Domino. It can be done, but you are losing much of the power of Domino at the same time as your are fighting how it wants to work. Just because you are familiar with a rowboat does not mean you should try to row a sailboat, especially not when the sails are up and want to take you in another direction.

Subject: RE: Creating a document from HTML Form

Thanks for your responses Ben and Ethann

Well Ben…I am just exploring options by discussing with you people. As far as my understanding… domino convert its native forms into corresponding html forms on web and then submit this form with exact name to domino form. So how we are loosing functionality here. By using HTML form we can make looks more attractive. Moreover fields in form can change depending on requirement . That’s why I planned to use HTML form.

Please give me your inputs on that BEN…

Subject: RE: Creating a document from HTML Form

OK, for starters, Domino goes out of its way to prevent HTML tampering, so any field which does not exist on the Domino form to start with is not saved. There are tricks to get around this, but it is a basic security constraint of the system that you will have to fight. If you fight it successfully, you leave yourself open to the exact sort of HTML tampering which led to the constraint. It means a lot of coding in your WebQuerySave agent of URL settings that are severly constrained by URL size limits. The coding in the WebQuerySave agent has to be carefully done or you lose any of the flexibility you were hoping for with the HTML form.

Subject: RE: Creating a document from HTML Form

To put that in a non-Domino way:

The form you create in Domino Designer is the “CGI Script” for the submission. ALL of the submission handling is defined on the form – which fields are permitted, what data types are allowed in each field, etc. Some of that info may be “farmed out” to one or more WebQuerySave agents, but that happens AFTER the submission request is married to the form.

Now, fields defined on the form DO NOT need to be visible in the browser (or be included in the initiallly-served HTML, for that matter), so you can build a form with all of the fields you’ll ever need and only serve a subset of the fields initially, using DHTML to add fields as necessary. (In Designer, you’d use hide-when formulae to hide anything you don’t want served.) Every field you create, though, needs to exist on the Designer form.

As to appearance, well, there’s absolutely nothing stopping you from making a Designer form look any way you want it to on the web. In fact, the only difference you’d notice between a well-designed Domino form and a hand-crafted HTML form is the _doClick() JavaScript and the hidded __Click field. Take a look at passthru HTML if you want absolute control. As long as the field objects themselves are not marked as passthru, then you can do just about anything you want.

Subject: RE: Creating a document from HTML Form

You would be much better off using a standard Notes form. However you can do
what you want.

The Post action on the HTML form needs to point to an agent on a domino server

eg

The Agent needs to be written in either LotusScript or Java. The first thing
it will need to do is get the DocumentContext of the session. This will return
a Notes document containing all the field values from the form.

Look on the Domino Designer help database under “Web Agents” for more
information.

Regards

Ethann Castell
font color=“#FF7700”>Caliton&nbspInnovations
www.caliton.com]