Results 1 to 2 of 2

Thread: need a little help with this

  1. #1
    Join Date
    Dec 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default need a little help with this

    Script: "Accept terms" form submission
    http://www.dynamicdrive.com/dynamici...acceptterm.htm

    i need to know if and how this script could be edited to download a file on clicking the button instead of submitting the form, thanks for help in advance.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Well, there's two ways. You can either modify your form cgi/php script to invoke a download, or I suspect you're looking for an easier way, which is simply to use JavaScript instead. Try modifying the code:

    if (window.checkobj&&checkobj.checked)
    return true

    inside Code of Step 1 to:

    if (window.checkobj&&checkobj.checked){
    window.location="http://www.mysite.com/what.zip"
    return false
    }

    where "http://www.mysite.com/what.zip" is the path to your file to download. This only works if the file type (ie: zip) triggers a file download in the browser instead of simply loading it, such as a .gif.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •