Problem with Document Submit on Web - Works from one action, but not another

I’m creating a web application that has some actions at the top in a css formatted ‘button’ bar. This is the code:



Everything works perfectly. There are some popup ‘help’ tips that appear when hovering over the ‘buttons’, the css styling is great. No problems.

However, I copied the exact same code to the bottom of the form. The form is rather long so I wanted the buttons to also appear at the bottom. The problem is the ‘Submit as Complete’ action. At the top it works fine - if validation fails, it pops up a message box to the user, then leaves the user at the form to correct whatever was wrong. When I click this button at the bottom, the validation failed message pops up fine, but then instead of remaining at that page, I’m redirected to a different page http://serverName/Finance/FinDisc.nsf/0/ The server logs an error HTTP Web Server: Couldn’t find design note - 0 [Finance/FinDisc.nsf/0/]

Why am I seeing this behaviour? I copied the menu bar code so it’s immediately below the first menu and I have the same behaviour. It only works in the top menu bar. The validation works fine in either case, so I don’t think that’s it. This is my onSubmit code:

var form = window.document.forms[0];

if (form.Status == “Complete”) {

return validateFields();}

else {

return true;

}

and this is the code behind the ‘Save as Complete’ action:

if (validateFields()) {

document.forms[0].Status.value = "Complete";

document.forms[0].submit();

};

Any ideas why this would work OK in the first button bar, but not the second? This one is driving me crazy! Any ideas are appreciated.

Subject: Problem with Document Submit on Web - Works from one action, but not another

Karen, there’s got to be something else going on that you’re not seeing – perhaps an object conflict that’s confusing the JavaScript. It’s probably too much to get at in the forum. If you’re willing to send me a copy of the database (just the relevant design), I’m willing to take a look at it. My address is on my profile.