Focal Point
[Solved] Change Value of amper varilable in javascript

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

November 15, 2012, 12:37 PM
jgelona
[Solved] Change Value of amper varilable in javascript
I'm sure this has probably been answered before but I can't seem to find the answer. Seems to me it should be pretty easy but my javascript skills are sorely lacking.

We are converting many of our reports from Area to Region. When a report is displayed, we have a button we call the Criteria button. In this button, one can change the report parameters or even change to a different report without going back to the dashboard. Much of that button is javascript. I have finished converting the javascript for this Area/Region function but I have one last item. Depending on the report selected in the Criteria button, I need to change the value of &AREAREGN. How can I do that?

Here's the html
    <td class="options_label" width="53" height="3">
       <p class="p_class">!IBI.AMP.AREAREGN;</p>
    </td>


When one changes the report to be run, a javascript function is run. I need to modify the function to change the value &AREAREGN of depending on the report selected.

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


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
November 15, 2012, 01:48 PM
Francis Mariani
Once the text in the amper variable is plonked into the paragraph tag, it becomes just text - you cannot refer to the amper variable. If you give the paragraph tag an id or name, you can refer to it with JavaScript and change its value, with the innerHTML property.

javascript innerhtml


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
November 15, 2012, 02:00 PM
jgelona
Thanks Francis, I just found out about innerhtml and it did exactly what I wanted.

Here's what I did. I changed the html to this:
    <td class="options_label" width="53" height="3">
       <p class="p_class" id='AREAREGN'>!IBI.AMP.AREAREGN;</p>
    </td>


Then stategically placed the following in the javascript
document.getElementById('AREAREGN').innerHTML='Area:';
document.getElementById('AREAREGN').innerHTML='Region:';



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
November 15, 2012, 02:20 PM
Francis Mariani
That's it Smiler


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
November 15, 2012, 03:57 PM
Waz
Keep an eye on what borwsers are being used and that the code is supports on all the different flavours used.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!