Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display text from an htm file as source

Status
Not open for further replies.

WenGat

Programmer
Mar 6, 2002
1
US
I have a dynamic text field that I want to fill with the contents of an htm file. I need to do this because I want the text displayed on the screen to be different depending on the 'product' the viewer has selected to see. It is not a different image (picture), it is a different description (text).
 
You can either place some (calculated)
value into a dynamic layer or into
a form-field. But for Javascript to read
a complete html-file (all code
from <html> to </html>) is impossible.

So, assuming you want to place a calculation
into a form field, try something like this.

somewhere in body:

<form name=&quot;myform&quot;>
<input name=&quot;myinput&quot;>
</form><br>
<a href=&quot;Javascript:calculate()&quot;>go</a>


and somewhere in your Javascript:

function calculate()
{
var myvalue;
myvalue = (3 * 6);
document.myform.myinput.value = myvalue;
}

I typed the above without testing it first,
but I supposed you can work it all out now...

Good luck,

Tristan Laurillard
harlekeyn@gmx.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top