Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     passing multiple values from one html to another

Read-Only Read-Only Topic
Go
Search
Notify
Tools
passing multiple values from one html to another
 Login/Join
 
Silver Member
posted
I need anyone's assistance in accomplishing this task. What I'am doing is trying to pass values from one form to another without any success.

We have an apps that and is functional right now, but the users have to scroll down to look at the other fields in order to select the values. I thought it would be a great idea to have the drop down box to pop up and pass back the values to the main form

Help!!!!



jbond7

7.61, nt


7.61, nt
Output: excel, pdf, html,
 
Posts: 33 | Registered: January 10, 2008Report This Post
Expert
posted Hide Post
When you post code you need to place [ code] (without the space) before your code and [/code] afterwards. Then your code will be displayed correctly without being interpretted as HTML and giving us a headache trying to help you.

Go back and edit your posts by clicking on the middle icon below right of your posts and make the changes so that we can see them.



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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
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.

TexasStringRay posted this a while back: which also works


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 {
/* 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');

Hope this helps!

-------------------
WF 5.33 (virtual server 7.17 / 7.64) Windows Server 2003


WF 7.6.10 /IIS 6/ JBoss Enterprise 4.3
Windows XP SP 2/Windows 2003 Server
MVS 7.3.3
 
Posts: 76 | Location: Hartford, CT | Registered: August 30, 2005Report This Post
Expert
posted Hide Post
J,

The method that JB is refering to here is passing from a child (or modal) HTML form back to the parent which is perfectly feasible.

Take these two HTML files -
<html>
<head>
<title>HTML Launch Page</title>
<script language=javascript>
function get_value() {
  var url = "http://localhost/HTML_Form.htm?Rand="+Math.floor(Math.random()*100000);
  var ReturnValue = showModalDialog(url,"","dialogWidth:140px; dialogHeight:225px; status:no; center:yes");
  document.getElementById("textbox").value = ReturnValue
}
</script>
</head>
<body onload="get_value();">
<form id=form1>
<input type=textbox value="Not set" id="textbox" name="textbox1">
</form>
</body>
</html>


<html>
<head>
<title>HTML Form 1</title>
<script language=javascript>
function pass_value() {
  ctrlCol = document.getElementsByName("rbtn");
  for (i=0;i<ctrlCol.length;i++) {
    ctrlId  = ctrlCol(i).id;
    ctrlObj = document.getElementById(ctrlId);
    if (ctrlObj.checked) {
      returnValue = ctrlObj.value;
    }
  }
  self.close();
}
</script>
</head>
<body>
<form id=form1>
<input type=radio checked value="Value 1" id="rbtn1" name="rbtn">Value 1<br />
<input type=radio value="Value 2" id="rbtn2" name="rbtn">Value 2<br /><br />
<input type=button onclick="pass_value();" value="Return Value">
</form>
</body>
</html>

The first one is the launch page and on opening sets the second as a modal form. This means that you cannot access the underlying one until you have closed the modal form.

When you make your choice on the modal form and close it, the original HTML page processes the returned value and populates the textbox with that value.

The advantage of using this type of control over a standard JavaScript prompt function is that you can use combo boxes etc.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
I guess using code tags is a little too troublesome? Please make the effort and change your previous posts so that we can see what code you are using without jumping through hoops by viewing source and then untangling your pieces apart from the forum code.



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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Tony,


will this work on multi-select values?


7.61, nt
Output: excel, pdf, html,
 
Posts: 33 | Registered: January 10, 2008Report This Post
Expert
posted Hide Post
JB,

Yes, because the modal form is an actual HTML page in its own right and can therefore contain any HTML form control you care to code.

T

p.s. well done for making this topic easier on the old eyes Wink



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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Tony,

It could be me, but this didn't do the job.


7.61, nt
Output: excel, pdf, html,
 
Posts: 33 | Registered: January 10, 2008Report This Post
Expert
posted Hide Post
I use it for checkboxes, radio buttons and a multi select box with contents built from the XML output of a fex.

Works like a dream and so much better than prompting.

The sample I gave above works independently of WF and does not use WF at all. The intent was to show how you can achieve it with HTML and JavaScript first before you migrate it to WF.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     passing multiple values from one html to another

Copyright © 1996-2020 Information Builders