Return to predefined URL after submit

Posted on 2001-07-04
Last Modified: 2013-12-18
R507; webapplication:

In a document or a view, a user clicks on an action, trigering an agent, passing the users current url through the new url:
The reason is that -later in- I want to return there.

The agent creates a document in a different database, sets a few fields and saves. Then an new url is composed to open that new documention editmode and -again- passing the original url:

After filling out some additional fields, the user presses a submit action. The authornames field is now given a different value (the user is not allowed to re-edit the document) and the document is actually submitted.

All this happens in javascript. The annoying thing is that I can't both save the docuemnt and return to the original url (preferably using location.assign()). It's no problem isolating originalURL but when I address it, the doc appears unsaved -even after adressing is AFTER submitting!-. When I only submit (save) the document, the form's action is triggered: the ?EditDocument, logically resulting in an error.

$$Return seems to have no effect on the forms action or what happens.
The onSubmit-event is added to the <FORM>-tag, but has no effect either.

I have done this before. What am I doing wrong this time?
Question by:CRAK
  • 5
  • 3
  • 2
  • +1
LVL 24

Expert Comment

ID: 6252862
At the end of the agent after everything is executed and doc is saved, Execute a print statement like this

Print "[]"

This will open the page, this url can be relative too.

LVL 13

Author Comment

ID: 6253060
Sorry Hemanth, I know the technique (used it to open the doc in edit mode), but it does not work here....
As I said: I've done it before; there must be something really weird going on here!

In my keyboard as well.... so many typing errors in my question. Can't be me! ;-))

I'll try to involve WebQuerySave: that's the only LOGICAL thing that I haven tried yet. Will let you know tomorrow.
LVL 10

Expert Comment

ID: 6253128
Hello CRAK,

perhaps you mess this: the correct action for storing a document is not ?EditDocument ;-))
The correct one is: ?ComposeDocument

LVL 24

Expert Comment

ID: 6253704
LVL 13

Author Comment

ID: 6254534
The document was already created and saved in the back-end. The user only has to fill out one or two additional fields. ?ComposeDocument would create ANOTHER new document.

But I've worked thinks out last night. That URL that is supposed to bring back my original page is retrieved (in javascript) from the URL, using Query_String. In e.g. http://newdocUrl?EditDocument&SourceUrl=originalUrl I locate "&Source=", keep everything trailing it and discard the rest. Then I add "&" at the end, locate the first "&" (more parameters MAY be entered) and isolate everything preceding it, using myUrl.substring(start, end).

The error I made resulted in end=0.

Simple stupidity....

Sorry guys.... mind if I delete this question?
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

LVL 10

Expert Comment

ID: 6254588
hey, from my side, I do not mind at all <|;-)

Allow me only one joke: the most errors sit in front of the keyboard :-))
LVL 13

Author Comment

ID: 6254878
I'll check with my parents.... see if they can get my bugs fixed ;-o
LVL 13

Author Comment

ID: 6254888
Why did you change your name?
LVL 10

Expert Comment

ID: 6255387
this name change was a bug fix ;-)

when I was creating my EE account in 1998 I was checking only the account "Zvonko" (my FirstName). It was in use, so I choose this stupid synonym (stamp, ha ha).
Now I have to pay for this ;-)
The Proppercase name was registered by an Croatian who newer posted nor asked for eneything. But the EE comunity support told me: it is not a problem; take the first letter lowercase and it will work. So, I start now from scratch. Transfering expert points and history is still not possible in EE (I meen: renaming stamp to zvonko). Only offer from EE was to give me question points from stamp...
LVL 13

Author Comment

ID: 6392246
I found solution myself. The problem wasn't caused by some unexpected program behaviour, but by a simple typing error.

I don't think others will learn a great deal from a silly thing like that.

I can't reward points to either of the participants: I am sure that they both know how to solve a problem as described, but:
- neither mentioned "typing error", and
- rewarding one would be unfair to the other


Accepted Solution

Netminder earned 0 total points
ID: 6809796
Points refunded and question closed per user request (user resolved question).

Community Support Moderator
Experts Exchange

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now