Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Web form not saving all of the time?

Posted on 2003-03-06
19
Medium Priority
?
250 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
  • 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
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.

 
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

Technology Partners: 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!

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

571 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