how to use the onlick event on button

P

Philippe

I have this piece code that is not working:
input type="button" value="Report Search" name="ReportSearch"
style="position: relative; left: 60"
onclick="window.location='c:\files\mpr.doc'">
when I click on the botton, it doesn't take me to that file.
Please advice.
Thanks
 
S

Steve Easton

Because the browser won't let you use it to open a file on the hard drive

Place the file in your web and then use:

<input type="button" value="Report Search" name="ReportSearch"
style="position: relative; left: 60"
onclick="window.location='mpr.doc'">

If the file is in a different folder than the page with the button the path would be
onclick="window.location='foldername/mpr.doc'">

Also, unless your using name="ReportSearch" to apply a css class or define the html element for a
javascript, it can be removed as it's not needed.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 

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

Top