开发者

How would I set a checkbox to activate a link in a wordpress blog?

开发者 https://www.devze.com 2023-01-01 19:42 出处:网络
I want to be able to let people download stuff from the blog, like code for people to use.But I want to make sure people read the \"License/Copyright\" stuff before hand.It would say something like, \

I want to be able to let people download stuff from the blog, like code for people to use. But I want to make sure people read the "License/Copyright" stuff before hand. It would say something like, "Check to agree to terms and开发者_JAVA百科 conditions" and when they click it the download link is activated.

Bonus: records their IP address from where they downloaded it, and the time when they downloaded it.


If you are using jQuery, you could do something like this:

$('.checkbox').click(function() {
    if (this.checked) {
        window.location.href = "/url/to/download";
    }
    else {
        // error handling
    }
})

If you're not using jQuery let me know and I'll whip up a pure Javascript example.

0

精彩评论

暂无评论...
验证码 换一张
取 消