Focal Point
passing radio buttons to another HTML page

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

September 13, 2007, 08:27 AM
jbanas6
passing radio buttons to another HTML page
I have two radio buttons (a & b) that when clicked call a procedure to check for the users security rights. I am having issues passing the variables for the radio buttons from one page to another html page. Any help would be great.


WF 7.6.10 /IIS 6/ JBoss Enterprise 4.3
Windows XP SP 2/Windows 2003 Server
MVS 7.3.3
September 13, 2007, 09:57 AM
Francis Mariani
You can only pass form object values from one HTML file to another via cookies or JavaScript.

You can pass the variable to a FOCEXEC that has HTML in it, which is the easiest method.


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 13, 2007, 10:15 AM
Tony A
Make sure that the controls are named -

<input type=radio name="myradio" .....


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 13, 2007, 10:59 AM
TexasStingray
Here is some JavaScript I wrote a while back.
var idx = document.URL.indexOf('?'); /* parameters on this URL? */
var params = new Array(); /* define an array */

if (idx != -1) /* if any params detected */
{
  /* split all the parameters as deliniated by an "&" */
  var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
  /* go through all parameters detected */
  for (var i=0; i<pairs.length; i++)
  {
    /* grab the variable and the value */
    nameVal = pairs[i].split('=');
  eval("V_"+" = new ParmResult(nameVal[0], nameVal[1]);");
  params[eval(params.length)] = eval("V_");
  }
}

function Request(parmname)
{
  if (params.length > 0) 
  {
    for (i=0; i < params.length; i++) 
    {
      if(params[i].name == parmname)
      {
        return params[i].val
      }
    }
  }
return null
}

function ParmResult(name, val) 
{
  this.name = name;
  this.val = val;
}


to use it you must have an form method of get or create the url with the parameters on the url (that is what GET does).

In your javascript call the Request function passing the Name of the URL Parameter that you want to find the value of
example: To get the val of the parameter called UserID in the Below url

http://localhost/test.htm?UserID=ABC1234

var UserID = Request('UserID');




Scott

ok, here is what i have so far...

<FORM ACTION="jbs2.htm">

<TR> 

<input type="radio" name="j" value="j1" CHECKED> j1
    	<input type="radio" name="j" value="C1"> C1</p>
</TR>
<TR>
<td><input type="submit" </TD>
    <input type="hidden" value="test1">
</td>


the next page then needs to take the values selected from here and pass them into the code. The function used for this is the following:

function Mtest() {
if(document.test.j[0].checked) {
var URL="/cgi-bin/ibi_cgi/ibiweb.exe?IBIF_focexec=test1" + "&"
+ "j1=j1"
parent.page.document.URL=URL;
}
if(document.tocform.j[1].checked) {
var URL="/cgi-bin/ibi_cgi/ibiweb.exe?IBIF_focexec=test1" + "&"
+ "c1=c1"
parent.page.document.URL=URL;
}

This message has been edited. Last edited by: Kerry,


WF 7.6.10 /IIS 6/ JBoss Enterprise 4.3
Windows XP SP 2/Windows 2003 Server
MVS 7.3.3