OnClick event handler to show PDF file?

T

Todd Cary

[The code is running in PHP]

Currently, I have a Link to show a PDF file

<? print('Click <a href="' . $url . $sfyc_race_schd_send . '" Name="Race
Schedule" Target="_blank">here</a> to open the Race Schedule'); ?>

I want to replace it with a button and an OnClick()

<?
print('<input type="button" name = "View Schedule" OnClick="">');
?>

I cannot get the syntax correct for the OnClick. Is this the best way
to use a button for the task?

Todd
 
I

Ivo

Todd Cary said:
[The code is running in PHP]

Currently, I have a Link to show a PDF file

<? print('Click <a href="' . $url . $sfyc_race_schd_send . '" Name="Race
Schedule" Target="_blank">here</a> to open the Race Schedule'); ?>

I want to replace it with a button and an OnClick()

<?
print('<input type="button" name = "View Schedule" OnClick="">');

<? ... onclick="window.open( \''. $url . $sfyc_race_schd_send.'\'
,\'_blank\' ); " ... ?>

should pop-open your file just like the link.
HTH
Ivo
 
T

Todd Cary

Ivo -

Many thanks! I got the OnClick() to work in bringing up the file, but
what I really needed was the new window!!

Todd
[The code is running in PHP]

Currently, I have a Link to show a PDF file

<? print('Click <a href="' . $url . $sfyc_race_schd_send . '" Name="Race
Schedule" Target="_blank">here</a> to open the Race Schedule'); ?>

I want to replace it with a button and an OnClick()

<?
print('<input type="button" name = "View Schedule" OnClick="">');


<? ... onclick="window.open( \''. $url . $sfyc_race_schd_send.'\'
,\'_blank\' ); " ... ?>

should pop-open your file just like the link.
HTH
Ivo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top