Focal Point
passing &variables to a frame

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8981016742

September 19, 2007, 11:35 AM
jbanas6
passing &variables to a frame
I have a form that submits amper variables to a fex which works fine. I would like the html page to call another html page that has 2 frames in it(a left frame and a main frame). When i submit the variables they seem to get lost in passing. Can anyone offer any suggestions on how to pass &variables to a frame ?


WF 7.6.10 /IIS 6/ JBoss Enterprise 4.3
Windows XP SP 2/Windows 2003 Server
MVS 7.3.3
September 19, 2007, 11:52 AM
Francis Mariani
You cannot pass variables to an HTML page - that's a basic tenet of HTML. You can, however, store the variables in a cookie or pass JavaScript variables from one HTML page to another.

The easiest method in the WebFOCUS world is to call a WebFOCUS program instead of an HTML page, with the program containing the HTML within -HTMLFORM BEGIN and -HTMLFORM END statements.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 19, 2007, 05:26 PM
Gizmo
You can access the parameters that were passed to the page using javascript. The values are in location.search and must be unescaped and parsed.

I set up a main page to take the parameters as follows
<html>
<body>
<form action='frameset.html' method=get>
Name:<input type=text name=username><br>
Age:<input type=text name=age><br>
<input type=submit value=Run>
</form>
</body>
</html>


Then my frame set contained
<frameset cols="10%, *">
  <frame src='leftframe.html'>
  <frame src='rightframe.html'
</frameset>


The right frame contained
<script>
document.write(unescape(parent.parent.location.search.substring(1, parent.parent.location.search.length)));
</script>


You need to use parent twice since the first parent would be the frameset and the second parent would be the html page that contains the frameset for which you called.

Once you have the location.search string, you can then use javascript using indexOf and substring to get each of the values.



Windows: WF 7.6.2: SQL Server 2008 R2
September 20, 2007, 07:37 PM
susannah
wow. thanks for that, Giz.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 21, 2007, 08:40 AM
jbanas6
thanks Gizmo, that worked perfectly


WF 7.6.10 /IIS 6/ JBoss Enterprise 4.3
Windows XP SP 2/Windows 2003 Server
MVS 7.3.3
September 21, 2007, 04:37 PM
Carol Dobson
Good post Jon!



WebFOCUS 7.6.6/TomCat/Win2k3