At the moment, it will only work with get forms (data is submitted in the url).
Eventually, I'll make a way of extending existing widgets to make then act as form elements.
This is how it works:
DynAPI.include('afrogui.form.form');
DynAPI. {
testForm=new DynForm("http://www.altavista.yellowpages.com.au/cgi-bin/query");
testForm.addElement(new FormObject('mss','simple'));
testForm.addElement(new FormObject('pg','q'));
testForm.addElement(new FormObject('kl','en'));
testForm.addElement(new FormObject('what','web'));
query = testForm.addElement(new FormObject('q','+jscript
+download +url +contents +source +code'));
alert("A search form is about to be submitted to
Altavista.");
testForm.submit();
};
This sample creates a form used to search altavista. In the FormObject, the first parameter is the value name and the second is the default value.
To show what could be done, check out here. It also uses a few of my other widgets (dialog, textbox, button, etc).
Strolia-Davis Christopher Contr MSG MAM wrote:
Luca,--The DynAPI could really help with something like this. Because of some
caveats with Netscape, this can be really difficult to do without using
layers. Yes you can add fields to the form, but getting them to actually
show up without a history.go(0) and then losing all of your previously
entered data is a pain.What may work better is to create an array to hold your clients values.
Then use a setHTML on a layer to create the form object and display it to
the user. When the user wants to add a control, add some info about it to
the array, and make sure you are saving value information to your array as
well. The recreate the form text and set the HTML to the layer again.There may be a better way, but this is what jumps to mind.
Hope this helps you get started,
Later,
Chris
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 3:19 AM
To: [EMAIL PROTECTED]
Subject: [Dynapi-Dev] Create a form which "grows" as user needsDear DynApi-Dev
I am trying to use DynAPi in order to create a page which "grows" before
submission.
Namely,
A page is generated which contains some fields to fill in.
However there is one field which may have multiple values.
SInce is not known how many values the user would need to have, and would
be extremely
poor from a stylistic point of view either hardcode the number of fields or
use a CGI-posting method
to iterate until the final submit is given, I would like to use DynApi to
do that.I have checked dozens of DHTML and Javascript sites as well as dejanews but
could not figure how
to do that in practical terms.I have then tried with dynapi and failed.
I would very much appreciate your support / suggestions.
In my opinon, the DynApi does not yet implements ways to handle the above
problem.
I have tried with the List object but always got the IE5 to crash.I will very much appreciate your advice.
Sorry for the triviality of the question.
Luca_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev
Michael Pemberton
[EMAIL PROTECTED]
ICQ: 12107010
form.zip