Click to See Complete Forum and Search --> : Help to change a button to a hyperlink
Dr. Possible
08-14-2003, 12:23 PM
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.
AdamGundry
08-14-2003, 12:30 PM
<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.
Dr. Possible
08-14-2003, 12:44 PM
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'><a
href="#" onClick="WinOpen()">Print</a></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.