<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="cache-control" CONTENT="no-cache">
<META http-equiv="Pragma" CONTENT="no-cache">
<META http-equiv="Expires" CONTENT="0">
<title>a title</title>
<SCRIPT language="_javascript_" type="text/_javascript_" defer>
<!-- Initial screen size
// Full screen size
//top.window.moveTo(0,0);
//top.window.resizeTo(screen.availWidth,screen.availHeight);
// or centered, fixed screen size:
top.window.moveTo(screen.availWidth/2,screen.availHeight2/);
top.window.resizeTo(400,300);
//-->
</SCRIPT>
<script type=text/_javascript_>
<!-- Open new window with or w/o browser controls (change "setting" as desired)
var newwin=null;
function runCGI(passedParm) {
myParm=passedParm;
//mypage="//%pgmpath%///%pgm%/.pgm?&parm1=="+myParm;
mypage="myCGIpgm.pgm?parm1=" + myParm;
myname="newWinName";
m=50; // set screen margin, instead of using a fix new window size
w=screen.availWidth-(m*2);
h=screen.availHeight-(m*2);
settings ='height=' +h+ ',width=' + w + ',top=' + m/2 + ',left=' + m + ',scrollbars=no,resizable=yes';
newwin=window.open(mypage,myname,settings);
newwin.window.focus();
}
function closenewwin() { // Close new windows if the parent window is closed.
if (newwin != null && newwin.open) newwin.close();
}
//-->
</script>
</head>
<body>
<a href="" style="text-decoration:none">Link to my CGI</a>
<br /><br />Or:
<!-- tr runCGI('/%passedParm%/')" -->
<p style="color:blue;cursor:pointer" runCGI('/%passedParm%/')">Link to myCGI using JS...</p>
<br />
CGI:
<p> EvalR thisParm = %trim(zhbgetvar('myParm'))</p>
</body>
</html>
| [EMAIL PROTECTED]
Sent by: [email protected] 02/27/2006 10:25 AM
|
To: [email protected] cc: Subject: Re: [Easy400Group] passing parms from a prompt window |
CGIDEV2 has a ton of samples showing you how to pass data into a program from a browser, opening additional windows etc. Have you looked at any of them? To anwer you quickly if you have and are still confused, the browser starts the program with the URL http://server_name/directory/program.pgm?Parm1=data&Parm2=moredata
Your program would access the data in parm1 and parm2 with:
eval data1=zhbgetvar('PARM1')
eval data2=zhbgetvar('PARM2')
If you need to create a window that gets data with an input variable, then you need a form, and a post
<form name="inform" method="post" action="">
when the form is posted, it will construct the proper URL based upon the variables in the form that are designated input.
SPONSORED LINKS
How to format a computer hard drive
Cobol programmer
Iseries 400
How to format a computer
YAHOO! GROUPS LINKS
[EMAIL PROTECTED]
How to format a computer hard drive
Cobol programmer
Iseries 400
How to format a computer
YAHOO! GROUPS LINKS
[EMAIL PROTECTED]
