Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie html form question: Please help

Status
Not open for further replies.

Sudmill

Programmer
Apr 20, 2001
65
0
0
GB
Hi,

Im not a notes programmer, so the concepts may be different, but Im trying to put in a request to a developer and Im having difficulty in finding out if Domino is able to process a POSTed HTML form. Sorry if this is a dumb qu, but Im sure this is a very basic request!

Basically, I have a static html file which has a HTML FORM in it and is being served up from a webserver somehwere. Once someone clicks SUBMIT on this form, I want a domino process to pick this information up so that it can process (i.e. write it out to a database, which is not the difficult bit).

Can domino process HTML FORMs that have not been serverd up by itself, and if so how?
Any domino code snippets which would show how domino could process the in coming request would be very gratefully received !

Thanks for bearing with me!

Here is an example html form I have on a remote apache server;

<html><body bgcolor=&quot;#FFFFFF&quot;>
<form method=&quot;post&quot; action=&quot; name=&quot;quform&quot;>
<p> Type qu. here <input type=&quot;text&quot; name=&quot;question&quot;>
</p>
<p>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>
</p>
</form></body></html>


Cheers

John (Sudmill)
 
John,

I have run into similar issues now. Did you find the solutions to this??

Vincent(potatoegg)
 
Yeah acutally I did. Its incredibly easy. The HTML side consists of a strandard HTML form such as;

<form method=post action=&quot; name=&quot;formname&quot;>
Name <input name=&quot;name&quot; value=&quot;&quot; size=&quot;30&quot;>
<input type=submit value=&quot;Submit&quot; name=&quot;submit&quot;>
</form>

As you can see it calls a domino agent, which processes the data. (Havent got the Domino code here, but will try to find it for you.)

The Domino code in the agent was also very simple.
I remember that the problem with our Domino developer was that he was not searching on the correct keyword in the Domino help, but I cant remember what this is at the moment!
Cheers

John (Sudmill)
 
sudmill,

I would be interested to see how the agent process the data. It would be very much appreciated if you could should me the source code of the agent....

Thanks in advance.....
Vincent Liu
 
Ok here it is and its as simple as i said;


sub Initialize
Dim s As New NotesSession
Dim context As NotesDocument
Dim GoodieString As String

Set context = s.DocumentContext
GoodieString = context.Request_Content(0)

...
End Sub



At the ... you should handle your GoodieString (which looks like) &quot;parameter1=value1&parameter2=value2&parameter3=value3&quot;.

The &quot;parameter1&quot; will be the name of whatever text box is on your form and the value will be the text someone enters.

Best thing to do is build a function to separate key and value pairs and then save the information out to a document.

Hope this helps. Do I get a star(see text below this box) for answering my own, and your question? ;-)

Cheers,

J.
Cheers

John (Sudmill)
 
Sorry the string should read
&quot;parameter1=value1 & parameter2=value2 & parameter3=value3&quot;

without spaces!
Cheers

John (Sudmill)
 
Sudmill,

Thanks......Well, definitely this deserve a star [smile].

However, I think there is some limitation to this method as well. It would certain be ok if it only had a few fields as the URL has limitation of 256 characters (I think). So, it is not really viable to pass forms with big contents (e.g. text area without limitation. Agree???

Anyway, thanks for you help. I think this solutions should be good enough for now.

Potatoegg. Vincent Liu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top