/    Sign up×
Community /Pin to ProfileBookmark

Create 2 actions for my button (imposible?)

Hello,

im trying to figure out how i can create a form that will copy the text from a textbox and then whene pressed submit it will paste it self on a different webiste ( ofcourse depending on the ID of the textbox).

i have managed to create the java script that will copy the text to the clipbord but im having trouble creating a second action to the submit button that it will open a new window and paste whats stored in the clip board.

Here is the Code:

[CODE]<form name=”form”>
<input type=”hidden”>
<input type=”text” name=”ID” /><br>

<script language=”JavaScript” type=”text/javascript”>
/*<![CDATA[*/

/*]]>*/
function copy(text) {
if (window.clipboardData) {
window.clipboardData.setData(“Text”,text);
}
}
</script>
<input type=”button” value=”Copy To Clipboard” onclick=”copy(document.form.ID.value);”>
</>
</form>[/CODE]

now i need the button to do the following:
1) open in a new window a website ( any one that ill give it).
2) paste the code stored in the clipboard to the new opened website.

HELP PLZ.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

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