?
Solved

Web form not saving all of the time?

Posted on 2003-03-06
19
Medium Priority
?
249 Views
Last Modified: 2013-12-18
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
0
Comment
Question by:christmann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
  • 4
19 Comments
 
LVL 5

Expert Comment

by:AndrewJayPollack
ID: 8082128
Adam, have you tried using the else condition after the if(confirm()) to see if for some reason the confirm didn't happen.
0
 

Author Comment

by:christmann
ID: 8082369
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()?
0
 
LVL 5

Expert Comment

by:AndrewJayPollack
ID: 8082399
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 63

Expert Comment

by:Zvonko
ID: 8082710
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?

0
 

Author Comment

by:christmann
ID: 8083085
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.

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8083175
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.

0
 

Author Comment

by:christmann
ID: 8083239
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!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8083363
Which version is your Domino?
0
 

Author Comment

by:christmann
ID: 8083380
R6
0
 

Author Comment

by:christmann
ID: 8083423
R6
0
 
LVL 63

Accepted Solution

by:
Zvonko earned 1200 total points
ID: 8083500
Great! :-)

Ok, put this as formula for your $$Return Field on the Form Comments:
"<script>alert('document saved');window.opener.location.reload();window.close()</script>"

The $$Return Field can be hidden from browser.

Your Button on Comments form is doing this:
var f = document.forms[0];
if (confirm("Would you like to save your comments now?"))
    f.submit();


Good luck,
Zvonko



0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8083523
You can customize or remove this alert('document saved') to something more meaningful, like:
alert('Your Comments are stored now...')

and so on...

0
 
LVL 5

Expert Comment

by:AndrewJayPollack
ID: 8083544
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.  
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8083579
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 :-)

0
 

Author Comment

by:christmann
ID: 8083683
That was it!  Thank you so much.  Cheers.  Adam
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8083684
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

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8083695
Oh, too late :)

Thank you Adam for the points :-)

0
 
LVL 5

Expert Comment

by:AndrewJayPollack
ID: 8083702
so you're Zvonko, zvonko, and Stamp?   Do you have no other life besides this?
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8083752
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 :)


0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question