Focal Point
[CLOSED] Passing in variable or parameter values into a HTML form

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

November 27, 2018, 10:51 PM
wdusbank
[CLOSED] Passing in variable or parameter values into a HTML form
I have a HTML form that has 4 parameter values that are populated in the form with drop down lists that are chained together.

I would like to set and then pass in different values for these 4 parameters based on the user. I have looked in the forum postings and I haven't been able to find anything.

I would like to do as much in App Studio tool as possible.

Can any one share any logic or code on how to do this?

I'm using App Studio in 8.2.01M.

Any help would be appreciated.

This message has been edited. Last edited by: FP Mod Chuck,


WF 8.2.01M, MF MVS 7.6.5
November 28, 2018, 05:07 AM
Tony A
One way would be to perform an Ajax call in an "onInitialUpdate" function and then set the drop down list selected value to the value(s) returned.

This can be achieved within the "Embedded JavaScript" tab and, as you're on WF8.2.01 (per your other post), you can make use of jQuery - which is easier.

The question is, do you have JavaScript knowledge or not? If you do, then good. If not, then giving you example code wouldn't help you much because you might not understand what it does.

If you do not have jQuery knowledge (or JavaScript) then I would suggest that is your next step.

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 
November 28, 2018, 09:58 AM
Joel Elscott
Are you asking how to populate your variables on load, based on values passed in? If so, then this can be done by passing the amper variables from your URL to the page.

https://servername.com/portalname?country=JAPAN

Then in the Embedded JavaScript, code the following function. You'll also want to trigger this JS function on load in the tasks and animations panel. Take note of the control's unique identifier - in the example below it's edit1 but yours would be whatever your dropdown list name is.


  
function passURLValues(){
  // split up the url following the ? into an array of name=value pairs
  var qStringArray = parent.location.search.split("?");
  var j;


  // loop through the array of name=value pairs and look for "country"
  for (var i=0; i < qStringArray.length; i++)
  {
    // split up each name=value string into name and value
    j = qStringArray[i].split("=");


    // the parm of interest
    if (j[0].indexOf("country") >= 0 )
    {
        //decode value from url
        var parm = decodeURIComponent(j[1]) ;


        //edit box to be populated
        var edit1 = IbComposer_getComponentById('edit1') ;


        //populate edit1 with parm
        edit1.value = parm;
    }
  }
}




WebFOCUS 8.2.03
z/OS