Link to home
Start Free TrialLog in
Avatar of christmann
christmann

asked on

Web form not saving all of the time?

I have a web-based form that is called from a button on another web-based form via this code:

var f = document.forms[0];
var url = "/" + f.DBPath.value + "/Comments?OpenForm&FormNum=" + f.FormNum.value;
dialogOpener(url, 'Dialog', 'width=515,height=200,status=no,resizable=no,scrollbars=no')


The form launches and allows me to enter some text in a comment box.  I then click save with the following code:


var f = document.forms[0];
if (confirm("Would you like to save your comments now?"))
{
     f.submit();
     window.opener.location.href = window.opener.location.href;
     window.close();
}


The problem is the form only saves about 1 in 4 times.  I cannot figure out any pattern behind this.  I have tried everything from changing the ACL to IE settings, etc.  It just works, then it does not.  If anyone can help, I would appreciate it.  I can provide more details if necessary.

Thanks, Adam
Avatar of AndrewJayPollack
AndrewJayPollack

Adam, have you tried using the else condition after the if(confirm()) to see if for some reason the confirm didn't happen.
Avatar of christmann

ASKER

Good advice, I should have thought of that too. I took the confirm out altogether.  It worked the first time, but not after that.  So, that is not the issue.  Is their an alternative to submit()?
submit should work, but what is the form tag?  Can you post that?

is it possible that in some cases, perhaps as a result of the back button or refresh or something a field is being posted with the form that does not correspond to a field on the notes side?

What is the $$Return field or querysave instruction on the notes form?  Try removing those, to see if the server will generate an error.
Avatar of Zvonko
What for is this line:
window.opener.location.href = window.opener.location.href;

Do you mean this one:
window.opener.location.reload();

Also from your url parameters I do read that you have some WebQuryOpen and also WenQuersSave agents.
Can we see them?

I changed the one line to:

window.opener.location.reload();

I do not have a WQO or WQS function on the comment form.  The other fields are:

I have an onLoad that places the cursor into the comment or text field where they type.

DBPath = @ReplaceSubstring(@Subset(@DbName; -1); " " : "\\"; "+" : "/")

FormNum = @RightBack(Query_String; "&FormNum=") which pulls the form number from the main form.

That is more or less it.  Thanks again for the help here.

Oh, now I see!

Your "Comments" Form does not have any document relation to the opener document!
The only correspondence is this string FormNum passed by Query_String, right?

You say you do not have a WQS for Comments Form. What do you have in $$Return of Comments Form? Or in other words, why should Comments create a new Notes document after f.submit();


My assumption is that you kill the connection with your window.close() before some document processing had time to proceed. The normal approach would be that your Comments popup window get a JavaScript from your $$Return to reload the opener and close itself. You do it in advance.

Query_String is the only relation.  I do not have a $$Return in the Comments form.

Do you have a more specific example of your comment -

The normal approach would be that your Comments popup window get a JavaScript from your $$Return to reload the opener and close itself. You do it in advance.

As you can see, I am missing some of the basics here.  On close of the comment form, I want to return to my original form.  I have only used $$Return to go back to a main menu.  How do I specify the form that is open on the other browser?

Thanks!
Which version is your Domino?
R6
R6
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can customize or remove this alert('document saved') to something more meaningful, like:
alert('Your Comments are stored now...')

and so on...

My friend Zvonko (not to be confused with zvonko) is stealing all my thunder these days!  He's doing a great job though, I have nothing to add.  
Andrew, this is now a special compliment to me :-)

Anyway, I was standing today also beside the boots why you was firing at this TRIM question :-)

That was it!  Thank you so much.  Cheers.  Adam
Hey Andrew, did I tell you that the account directly in front of you is also mine? I am also "stamp" :-)

But now is getting late for me. Can you please help Adam if he has additional questions and collect the points afterwards? :-)

See you,
Zvonko

Oh, too late :)

Thank you Adam for the points :-)

so you're Zvonko, zvonko, and Stamp?   Do you have no other life besides this?
This is the right question :(
The week before you registered here I was trying to lock myself out from EE to return to normal life.
After two weeks I asked EE to unlock me again.
I tell you this so you can see what nerd you are talking to :)