Focal Point
[SOLVED] How to dynamically change text on HTML page?

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

April 24, 2011, 06:23 PM
mark66
[SOLVED] How to dynamically change text on HTML page?
Hi,

I want to toggle a text label value on my form. I thought it would be a simple case of setting its value, but that does not appear to work?

Example:

function button1_onclick(ctrl) {
document.getElementById('text1').value = "Changed";
}


Using Dev Studio 7611.

Thanks

Mark

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


WebFocus 765. iSeries v5r4
April 24, 2011, 09:59 PM
Waz
That depends on what type of object on the form you are trying to change.


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!

April 25, 2011, 03:52 AM
mark66
Hi Waz,

Its a text label created from the Composer:

<SPAN id=text1 style="Z-INDEX: 1; LEFT: 120px; WIDTH: 300px; POSITION: absolute; TOP: 20px; HEIGHT: 50px" tabIndex=1 persistentuniqueid="compUid_2">Original</SPAN>  


Cheers


WebFocus 765. iSeries v5r4
April 25, 2011, 05:20 AM
<JG>
quote:
document.getElementById('text1').value = "Changed";



Not .value use .innerHTML


document.getElementById('text1').innerHTML = "Changed";
April 25, 2011, 05:50 PM
Waz
Also be careful with innerHTML, it may not work on all browsers.


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!

April 26, 2011, 03:57 PM
mark66
Hi JG, Waz,

Our uses just use IE and .innerhtml does the trick!

Thanks for your help,

Mark


WebFocus 765. iSeries v5r4