ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Post New Requests Here

Need buttons to download a file and disable used button, how to do so in HTML?

(1/5) > >>

I have several download buttons that are to be clicked only once, in a table.  Each button has an ID = "btnXXX", how does one get this to work?

Each button, set of two, has code as follows:

--- ---    <tr class="topic">
      <td>Descript 1</td>
      <td><a href="abc.ppt" download></a>
        <button Id="btn1-1" class="button btn1"
      <td><a href="abc.pdf" download></a>
        <button Id="btn2-1" class="button btn2"

This <tr> is duplicated some 10 to 20 times with different "Descript #", download file names, and button IDs.  Need a function "download_file" that downloads a file and disables used button.  There are two button IDs; btn1-# and btn2-#.  Each of these buttons may individually be clicked on in each <tr> set.  So e.g., 15 <tr> groups then 30 buttons for user to check from.

How are you going to save the downloaded-state for each file? As a refresh/reload of the page will re-enable any disabled buttons...

If you want an indication of what's been downloaded already, then present the downloads as links, default browser behavior is to give visited links a different color from new links, similar to:

No saving of downloaded info.

I would think you'd need to authenticate the user somehow, eg. user/pass, then you could use something similar as suggested here:

On user authentication, anything that relies on the client storing anything (eg. cookies), the IP, or software used for access (eg. browser fingerprinting), would be pointless as they can all be bypassed - so kind of falls back on the server to ensure single access only.

No, all my stuff is freeware including my math compiler :)  No user/pass type stuff on my website.


[0] Message Index

[#] Next page

Go to full version