/    Sign up×
Community /Pin to ProfileBookmark

Need print out help

I want to print out something out in a table so,
the “document.write(“text”)” won’t work because
it writes the text in a new plain html document.

Is there a way to print out something in to a table
or maybe a form so when i click on a link, somewhere on the site i a cell i the table som text appear?

Virran

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@JMRKEROct 12.2006 — Try writing the information to a 'pop-up' window that contains only the information you want to print. Close the window when done.
Copy linkTweet thisAlerts:
@virranauthorOct 12.2006 — that won't work since i want to make a series of "<br>" in certain locations, the number of "<br>'s" comes from different links, containing for example:

"<a href="#" onClick="br('2')">link</a>"

so...
Copy linkTweet thisAlerts:
@JMRKEROct 12.2006 — Do you have some HTML or sample script that you have started?
Copy linkTweet thisAlerts:
@virranauthorOct 12.2006 — This is when i'm just trying to print out something, later on i will do a for-loop in the function that prints out "<br>".


<html>

<head>

<script language="javascript" type="text/javascript">

function printOut(text) {

document.form.write(text);

}

</script>

</head>

<body>

<a href="#" onClick="printOut('5')">hehe</a>

<form name="form">

</form>

</body>

</html>
Copy linkTweet thisAlerts:
@JMRKEROct 12.2006 — In your sample code, I deduce the following:

1. You only print out '5' (at this time). I understand you plan on substituting '5' with something else at a later time.

2. You are trying to printout to the SCREEN not the PRINTER. I have been making the assumption that you wanted the latter.

3. The command 'document.form.write(text);' will not do what you want as the site will have been created (and finalized) by the time you click on the anchor tag of 'hehe'. You may want to look into the use of 'innerHTML' for this purpose. There are several examples when you search this forum.


Is this all you are trying to do?
Copy linkTweet thisAlerts:
@virranauthorOct 12.2006 — Yea it sounds like what I need, i'll search for some "innerHTML"

thx
×

Success!

Help @virran 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,
)...