/    Sign up×
Community /Pin to ProfileBookmark

Help to change a button to a hyperlink

This is what my button does:
————————————————————-

<body>
<input type=”button” value=”Print” name=”B3″ style=”font-family: Arial Rounded MT Bold; color: #000044″ onClick=”WinOpen()”>

</body>
————————————————————-

I just want the same thing to happen in a hyperlink instead of a button.

Does anybody know how to do this?

Thanks,
Matthew.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryAug 14.2003 — <a href="#" onClick="WinOpen()">Print</a>

Adam

P.S. This won't work for users with Javascript disabled, which it should to comply with accessibility recommendations. You should replace the # with the filename you are loading, to ensure it is accessible.
Copy linkTweet thisAlerts:
@Dr__PossibleauthorAug 14.2003 — Thanks for replying so soon.

That code looks like it will work in notepad, but when I tried to do it in paste it in MS Word's Script Editor program, it automatically changes it. I dont understand it now :/

This is the word "Print" that I have in my web page:
------------------------------------------------------------------


<td width="5%" valign=top style='width:5.16%;padding:0in 5.75pt 0in 5.75pt'>

<p class=MsoNormal align=right style='text-align:right'><span

style='font-size:10.0pt'>Print<o:p></o:p></span></p>

</td>
------------------------------------------------------------------



This is what the new code turns into:
------------------------------------------------------------------


<span style='font-size:10.0pt;font-family:Verdana;

mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman";

mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA'>&lt;a

href=&quot;#&quot; onClick=&quot;WinOpen()&quot;&gt;Print&lt;/a&gt;</span>
------------------------------------------------------------------



JavaScript in general looks like Chinese to me. I don't even know where to start with this.

So far the upper code is all just for the plain word "Print", and the lower code is your code for making a "Print" hyperlink that executes the WinOpen() function.

Could you please help me put them together - i.e.: make it so my existing word "Print", does your code?

Thanks, and sorry I am such a bone head about this stuff.

Matthew.
×

Success!

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