Web Form Loses Values When Submitted

Hi,

I have a form that is filled in via the web browser which has a subform which includes a searchform which is :-

Oracle

Web

Contacts

Documentation

I then have another form which has notes fields in a table the form tag name for this is BMV. at the bottom of this form there is a notes button which does @Command([FileSave]);@Command([CloseWindow]).

this then triggers the onSubmit event which has the following javascript

function getElements()

{

debugger;

var f = document.forms[0];

alert ( f.Attachment1.value );

f.AttachmentName1.value = f.Attachment1.value;

alert ( f.Attachment2.value );

f.AttachmentName2.value = f.Attachment2.value;

alert ( f.Attachment3.value );

f.AttachmentName3.value = f.Attachment3.value;

alert ( f.Image.value );

f.ImageName.value = f.Image.value;

}

getElements();

the AttachmentName(1-3) and Image values are notes fields in the second form and Attachment(1-3) are the File Upload Control values.

When the page is submitted it runs the above code, sets the values (you can see this happen in the form) then saves the document and redirects to a thanks page.

when you open the saved document in the database the field values are no longer set.

When i remove the subform with the first form on it it works fine.

Any ideas why this is doing this?

I have tried referencing the second for with the form name (document.BMV.XXX) but this makes no difference, it sets the values but they disappear.

I have tried debuggin it with Microsoft script editor and it seems to lose the values when the debugger goes through this section of code

document._domino_target = “_self”;

function _doClick(v, o, t, h) {

var form = document._DominoForm;

if (form.onsubmit) {

 var retVal = form.onsubmit();

 if (typeof retVal == "boolean" && retVal == false)

   return false;

}

var target = document._domino_target;

if (o.href != null) {

if (o.target != null)

   target = o.target;

} else {

if (t != null)

  target = t;

}

form.target = target;

form.__Click.value = v;

if (h != null)

form.action += h;

form.submit();

return false;

}

which is stored in what seems to be a header (i can view this code when i go view source on the page) have no idea where this is coming from?

Any help would be appreciated

Subject: Web Form Loses Values When Submitted

In continuation to my earlier post: Pls try removing the form tags from the search subform and then try. It should work.

Subject: Web Form Loses Values When Submitted

When domino renders a Notes form on browser, it automatically adds a tag in the beginning and tag at the end. Also, it puts in a lot of javascript code at the start. So your final page will have something like this (you can verify that using the view source):

…Domino generated javascript…

Oracle

Web

Contacts

Documentation

----HTML for Fields and File Upload controls u have created in the form—

If you observe this, you are nesting one form tag in another (search form nested in the notes BMV form) which is actually causing the issue and that’s why if u are removing the subform its working fine (as per your post).