/    Sign up×
Community /Pin to ProfileBookmark

quest help on The JavaScript Source: Forms: Select and Auto Copy

i have a quest need some help. I try this code on a website where u can design ur own webpage. However I enter the full code [Display 1] in and when i save I got error. When i click the button it wont select and cope. when i go back to the code and re-check the code i enter they appear Display 2. There are some missing part >.< can someone tell me what happen? >.< what i did wrong

[COLOR=Red]Display 1[/COLOR]

[CODE]

<HEAD>

<SCRIPT LANGUAGE=”JavaScript”>

<!– This script and many more are available free online at –>
<!– The JavaScript Source!! http://javascript.internet.com –>
<!– Original: Russ ([email protected]) –>
<!– Web Site: http://dblast.cjb.net –>

<!– Begin
function copyit(theField) {
var tempval=eval(“document.”+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand(“Copy”)
}
// End –>
</script>

</HEAD>

<!– STEP TWO: Copy this code into the BODY of your HTML document –>

<BODY>

<form name=”it”>
<div align=”center”>
<input onclick=”copyit(‘it.select1’)” type=”button” value=”Press to Copy the Text” name=”cpy”>
<p>
<textarea name=”select1″ rows=”3″ cols=”25″>
If this is highlighted, then it has been copied.
</textarea>
</div>
</form>
[/CODE]

[COLOR=Red]Display 2[/COLOR]

[CODE]

<HEAD>

<SCRIPT LANGUAGE=”JavaScript”>

<!– This script and many more are available free online at –>
<!– The JavaScript Source!! http://javascript.internet.com –>
<!– Original: Russ ([email protected]) –>
<!– Web Site: http://dblast.cjb.net –>

<!– Begin
function copyit(theField) {
var tempval=eval(“document.”+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand(“Copy”)
}
// End –>
</script>

</HEAD>

<!– STEP TWO: Copy this code into the BODY of your HTML document –>

<BODY>

<form name=”it”>
<div align=”center”>
<input onclick=”copyit(‘it.select1’)” type=”button” value=”Press to Copy the Text” name=”cpy”>
<p>
<textarea name=”select1″ rows=”3″ cols=”25″>
If this is highlighted, then it has been copied.
[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@xiaoxueauthorOct 08.2006 — anyone?
×

Success!

Help @xiaoxue 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...