How do I access a dynamically generated field on the Web through LotusScript?
<input name="somename" value="somevalue">
) through LotusScript?
To make my question clear, here is one of Dave Hatter's responses from SearchDomino.com to a similar question.
Question:
This question is regarding Domino Development. I want to create a set of fields on the fly for input in a form if the user clicks an action button.Answer:
On the Web, this is fairly simple. You can create a LotusScript or Java agent that dynamically generates the HTML for the page. I use this particular approach all the time.
One way to manage this is by generating HTML that contains two <FORM> tags. For instance, let's say your dynamically generated HTML is a table with three columns and an indeterminate number of rows. The field names are of the form A1, B1, C1, A2, B2, C3 and so on. Since there are no such fields on the Notes form, you want to store the data in the multivalue fields A, B and C in the document. In the default form that Domino creates in the HTML, you include hidden fields A, B and C (either via passthru or by selecting the form option to "generate HTML for all fields"). Then you use passthru to put out a </FORM> tag, and follow that with a new <FORM> tag that is set up such that the user cannot submit it. After that, put your dynamically generated fields, then a </FORM>.
On the first form, write JavaScript "onsubmit" event that harvests the data from the dynamically generated fields in the second form and assigns the hidden multivalue fields A, B and C. Assuming that there are not validation issues with this data, the onsubmit event will then allow the submission to proceed. Since you are submitting the first form, the names of the dynamic fields will not be sent to the server, but the data you copied from them will be. This is a good way to work with a table of information, since having lots of separate fields makes it impossible to display all the values with simple formulas on the form or in a view.
Another alternative is to have just one