/    Sign up×
Community /Pin to ProfileBookmark

using variables to complete textarea

is it possible to use a javascript function to create a text string and then use the return variable to fill in the value of the textarea in an html form?

This is the code.. (it and the website are very crude)

[code=html]<form name=”TheForm”>

<textarea name=”TheText” cols=”50″ rows=”4″ wrap=”VIRTUAL” readonly>&lt;table width=&quot;300&quot; height=&quot;300&quot; bgcolor=&quot;#000000&quot; border=&quot;0&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;div align=&quot;center&quot;&gt;&lt;a href=&quot;http://www.hostdrjack.com&quot; target=&quot;_blank&quot;&gt;&lt;embed src=&quot;http://www.hostdrjack.com/customcomments/samples/133a.swf&quot; quality=high pluginspage=&quot;http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;300&quot; height=&quot;272&quot;&gt;&lt;/embed&gt;&lt;br&gt;www.hostdrjack.com&lt;/a&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
</textarea>

<input name=”button” type=button onClick=”javascript:TheForm.TheText.focus();TheForm.TheText.select();” value=”Select Text”>

</form>[/code]

Since this code is repeated several times on the page, I would like to create a function that would create the string for the textarea. The variables passed to the function would be the filename, the width of swf file and the height of the swf file. The function would then add 25 pixels to the height and width and then return the string that goes in the text box.

this is the website [URL=http://www.hostdrjack.com]http://www.hostdrjack.com[/URL] which will be getting a complete overhaul soon, hopefully with more efficient programming.

Any directions would be greatly appreciated. Please keep in mind, I know some very basic javascript and no php. :rolleyes:

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

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