• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 574
  • Last Modified:

plain old button link

How do I create a button link?
The link points to a executible that I want the user to download

like this?
<FORM METHOD="LINK" action="software/vpn.exe"><a href="software/vpnclient.exe">
                    <p> <input value="get" class="button_match1"
                    style="float: right;" type="submit"></a>
                    </p>
                  </form>
0
Marketing_Insists
Asked:
Marketing_Insists
  • 4
  • 2
  • 2
  • +1
2 Solutions
 
_Maddog_Commented:
Well, if you don't want to use javascript, it can be as simple as that:

<FORM action="software/oakwoodvpn.exe">
<p> <input value="get" class="button_match1" style="float: right;" type="submit">
</p>
</form>

There's no such method "LINK", if you want to specify a method, use GET instead, or specify nothing.
Also, there's no need for the <a> tag. the action parameter can handle that.
0
 
Marketing_InsistsAuthor Commented:
Thanks

but some how instead of getting the link of the executible (vpn.exe), I just get the name (vpn)  I can still download the file, it's just without it's extension (unless I append it after downloading)

It works locally if you open it in your browser
  file:///c:/Apache2/htdocs/index.html

but not via http (clips off the .exe)
   http://myworkstation/index.html
0
 
Marketing_InsistsAuthor Commented:
so maybe ...

<form method="post" action="">
<input type="button" value="get" " 'some javascript thing here?' "software/vpn.exe">
</form>
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Marketing_InsistsAuthor Commented:
So, the button is obviously not meant to do anything but cgi stuff.  so what bit of code would allow a button to open a webpage?
0
 
_Maddog_Commented:
open a webpage?

in a new window:
<input type=button onclick="window.open('http://www.domain.com/page.html')">

in the existing window:
<input type=button onclick="document.location = 'http://www.domain.com/page.html'">


about the exe problem - it is possible that apache tries to run the exe on the server side.
0
 
jessegivyCommented:
Follow mad dog's good advice.

As for the download, you're gonna have to specify the correct content type, here ya go:

http://ppewww.ph.gla.ac.uk/~flavell/www/content-type.html
0
 
jessegivyCommented:
oh geez, why just post lengthy links, it's a good read though if you're up for it.  you just gotta set the enctype attrube of the form tag:

<FORM action="software/oakwoodvpn.exe" enctype="application/octet-stream">
<p> <input value="get" class="button_match1" style="float: right;" type="submit">
</p>
</form>

Cheers,

Jesse
0
 
JeffHowdenCommented:
Sounds like a good idea, but it's not.  The enctype attribute has only two acceptable values:

 - application/x-www-form-urlencoded
 - multipart/form-data

Further, enctype doesn't come into play at all when the method is GET (the default).

Why not just style a link to look like a button?

<a href="software/vpnclient.exe" style="border: 2px outset gray; background-color: gray; color: black; text-decoration: none; padding: 2px 5px">get</a>
0
 
Marketing_InsistsAuthor Commented:


Going by mad dogs example, I eventually mucked around and settled on:
<form name="form1" method="post" action="">
      <input type="button" class="button_match1" style="float: right;" value="Get" onClick="location.href='software/vpnclient.exe'">
</form>

The CSS  based button worked great
0
 
JeffHowdenCommented:
What plans do you have in order to support those without scripting?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now