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
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