Focal Point
passing a parameter through a URL

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

April 15, 2008, 12:37 PM
Tami K
passing a parameter through a URL
Hi - I hope someone can help me.
This is my url
http://server/approot/rental/test.htm
And i want to pass a variable to "test" and put the value in a text box. so i think my URL would look like this http://server/approot/rental/test.htm?id=123
Now how do i get the value of id into my textbox? I need to be able to get ahold of this value so i can use it. I would appreciate any help on this.
Thanks,
tami


WebFOCUS 7.6.0
Windows
Output: Excel, HTML and PDF.
April 15, 2008, 01:04 PM
Francis Mariani
Tami,

There have been many responses on the forum to questions exactly like this one.

There are several ways to do this, but the easiest method for a WebFOCUS developer is to call a WebFOCUS program instead of an HTML file. The WebFOCUS program could contain one line:

-HTMLFORM test


In test.htm you can include the variable being passed into a JavaScript variable or use it in the HTML code by placing the value of the WebFOCUS variable like this:

!IBI.AMP.id;


You would call the WebFOCUS program with a URL like this:

http://server-name/ibi_apps/WFServlet?IBIF_ex=test&id=123



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
April 15, 2008, 01:37 PM
susannah
Tami,
You might want to read up on FORM tags in HTML.
Get a basic HTML book from amazon, and see how variables are passed via FORM elements.
the FORM element called ACTION is the one containing your call to the webfocus engine.
If your FORM in your .htm contains no variable, the the click on the submit button produces your 1st example..
If your FORM in your .htm contains 1 variable, "id", then your click on the submit button produces your 2nd example.
Any help?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
April 15, 2008, 04:21 PM
Tami K
Thanks for your help and suggestions.


WebFOCUS 7.6.0
Windows
Output: Excel, HTML and PDF.
April 21, 2008, 03:54 AM
GamP
A bit late perhaps, but ...

If you really do have a requirement of being able to pick up the variable from your URL as you described in the first post, you could use some small javascript code to accomplish this. I had this requirement for an app I built some years ago. In this case it concerned a username that was present in the url as http://system/location?my username. The following code located the username string and presented it on the page:
  <table align="center" width=100% border=0 cellspacing=0 cellpadding=0>
   <tr><td><br></td></tr>
   <tr>
    <td class="textcenter">Welcome<br>
     <form name="user">
      <input type="hidden" name="name" size="35">
     </form>
     <script>
      var locate = window.location;
      document.user.name.value = locate;
      var text = document.user.name.value;
      var punt=text.indexOf("?");
      document.write(text.substring(punt+1,text.length)); 
     </script>
     <br><br>to my system</td>
   </tr>


Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988