Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webform field refresh

Status
Not open for further replies.

KC007

Programmer
Feb 24, 2003
4
Hi,
I'm passing some fields from a form A to another form B in the url by running an agent when a button is clicked in form A.
The agent has the following Print "[/" db.filePath "/RTest2?OpenForm&Typeofrequest=" CTor "&Custname=" CCname "]"

In the form B in the onLoad i'm calling the following function:

function initCL()
{
var Typeofrequest="", Custname="", Custname1="";
var parameters, i;

parameters= String(window.location.search).split("&")
for(i= 1; i<parameters.length; i++)
{
if(parameters.indexOf("Typeofrequest=")==0)
Typeofrequest= parameters.substr(14)
if(parameters.indexOf("Custname=")==0)
Custname= parameters.substr(9)
Custname1 = unescape(Custname)
}

var f = window.document.forms["MainContent"];
f.Typeofrequest.value= Typeofrequest;
//f.Custname.value= Custname1; ==> commented
}

So as soon as the form B is loaded, the first field 'typeofrequest' (dialogbox) is loaded with the value from the url which is fine.

Now the problem is form B has another field (Custname) which is a hidden field and is only visible when typeofrequest is "N".
So this dialogbox typeofrequest should be refreshed here. in the above case typeofrequest is N. but i want to refresh it
so that the custname can be visible and can accept the value from url (commented above).

Let me know if i'm not clear.
thanks
 
With the little web development I have done, I have found that the best way to obtain a field refresh in a browser is to save the document. It seems that it is the only way for the server to send updated info to the browser.
Of course, in that case, you need to ensure that the user can save the document multiple times, and that the multi-saves will not impact the intended functionality.
In other words, you have to implement safeguards to ensure that the "real" (or final) save is the one that counts in your process, and not the "refresh" saves.

Pascal.
 
sorry pascal,that does not work in this case.

As soon as the page is being displayed,
it should put the type of request first and then immeadiately it should refresh and typeofrequest and show the custname.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top