/    Sign up×
Community /Pin to ProfileBookmark

no subject yet

My code generates a large HTML page. At the end of the report, I want to update the top of the page with a summary of the report. But I can’t figure out how to add data to a ‘div’ or ‘span’ area at the top of the form.

Here is the HTML output:

[CODE]<html><head><body>
…text, table, more text…
<div>
<span style=”font: 12pt Time New Roman; font-weight:bold;text-decoration:underline”>
Countries selected</span>
<br><br>
<div id=”searchParms”></div>
… lots and lots of data goes here…
</div>[/CODE]

All the stuff printed in “lots of data” comes from a set of documents, each of which stores a country. I want to add the countries from those documents to div “searchParms” at the top of the form. Bear in mind, the countries are not available to me until I have printed out all the data.

I’ve tried adding the list by setting window.document.searchParms = “the list of countries”

I’ve also tried window.document.searchParms.innerText, window.document.forms[0].searchParms and window.document.forms[0].searchParms.innerText.

How can I add the list of countries to the top of the report?

Thanks,
-Jeff

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Alon_C_Aug 23.2005 — If I understand correctly, use the [B]position:absolute[/B].

Here:
[CODE]
<html><head><body>
...text, table, more text...
<div style="position:absolute;top:0;left:0">
<span style="font: 12pt Time New Roman; font-weight:bold;text-decoration:underline">
Countries selected</span>
<br><br>
<div id="searchParms"></div>
... lots and lots of data goes here...
</div>[/CODE]
Copy linkTweet thisAlerts:
@ScriptageAug 24.2005 — document.getElementById("searchParms").firstChild.data = "blah blah blah";
Copy linkTweet thisAlerts:
@JSchwarzauthorAug 24.2005 — Scriptage, thanks for the needed syntax. I got it to work by using "innerText" instead of "firstChild". firstChild returned null.

Here is my final answer:

document.getElementById("searchParms").innerText = "blah, blah, blah, blah....";

Thanks.

-Jeff
×

Success!

Help @JSchwarz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...