Author Topic: Visitor should agree to the terms and conditions, but how?  (Read 19763 times)

0 Members and 1 Guest are viewing this topic.

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Visitor should agree to the terms and conditions, but how?
« on: July 17, 2005, 09:27:12 AM »
I would like for my visitor to check a box when he/she is about to upload a picture, where it says that he/she has read the "Terms and conditions for uploading a picture" and agree to it.

When I search for this, all I get it Vano's MOD: http://www.4homepages.de/forum/index.php?topic=7109.0

This is, however, not what I'm looking for. Hope you understand what I mean
Greetz: Lasse

TheOracle

  • Guest
Re: Visitor should agree to the terms and conditions, but how?
« Reply #1 on: July 18, 2005, 03:50:03 AM »
By implementing this :

http://www.4homepages.de/forum/index.php?topic=7113.0

and post your request further to that topic. This way, that MOD could expand and would probably fit your needs in a matter of time. ;)

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Visitor should agree to the terms and conditions, but how?
« Reply #2 on: July 18, 2005, 11:59:16 AM »
No, you don't understand. There's really nothing to my request, fairly simple what I'm asking for. I would just do it myself, if I knew how to. I take it it's some simple javascript tag that's required. I will try to explain again, what i'm looking for:

When you fill out the upload form, I need a "checkbox" at the bottom, that the user have to check before being able to submit the picture. Now, if the user DO NOT check this box, an alert, of some kind, should pop up saying it's necessary to check the box (agree to the terms and conditions about uploading the photo) in order to submit a picture.

Frankly, now that I think about it, it should be able to be done with a simple javascript code (at least I think so  :mrgreen:)

Awaiting reply!

Thanks!
Greetz: Lasse

TheOracle

  • Guest
Re: Visitor should agree to the terms and conditions, but how?
« Reply #3 on: July 18, 2005, 02:19:34 PM »
Javascript would be a good thing. Although, it cannot garanty the success on all browsers.

Let's try this for instance.

Note: This is untested.

// Step 1 :

In your templates/<your_template>/header.html file, below ' <head> ' tag,

add :

Code: [Select]

<script>

var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Please read/accept terms before uploading to {site_name}")
return false
}
}
}

</script>


// Step 2:

In your templates/<your_template>/member_uploadform.html file,

replace :

Quote

<form method="post" action="{url_member}" enctype="multipart/form-data" onsubmit="uploadbutton.disabled=true;">


with :

Code: [Select]

<form name="agreeform" action="{url_member}" enctype="multipart/form-data" onSubmit="return defaultagree(this)">


;)

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Visitor should agree to the terms and conditions, but how?
« Reply #4 on: July 18, 2005, 02:24:17 PM »
Thanks man! Appreciate it. But I still need the code for the checkbox and it's "id" (or whatever), don't I?
Greetz: Lasse

TheOracle

  • Guest
Re: Visitor should agree to the terms and conditions, but how?
« Reply #5 on: July 18, 2005, 02:26:54 PM »
The checkform object is already implemented on your template's header. ;)

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Visitor should agree to the terms and conditions, but how?
« Reply #6 on: July 18, 2005, 04:46:15 PM »
Appreciate your effort in this matter, but you still don't understand what I mean.

Hold on, I'll find a site that has this.. I can use that as an example
Greetz: Lasse

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Visitor should agree to the terms and conditions, but how?
« Reply #7 on: July 19, 2005, 12:57:16 AM »
but you still don't understand what I mean.
TheOracle's method is the easiest one and IMO aficient one. But I'm not sure what agreesubmit() function does...

Basicaly all u need is the step 2 (step 1 is not needed), but replace that line with this:
Code: [Select]
<script language="javascript">
  function defaultagree(f)
  {
    if (f.terms.checked)
    {
      return true;
    }
    alert("Please read/accept terms before uploading to {site_name}")
    return false
  }
</script>

<form method="post" action="{url_member}" enctype="multipart/form-data" onsubmit="if (defaultagree(this)) uploadbutton.disabled=true; else return false">

and also u'll need add your checkbox in that template:
Code: [Select]
        <input type="checkbox" name="terms" value="1"> terms
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

TheOracle

  • Guest
Re: Visitor should agree to the terms and conditions, but how?
« Reply #8 on: July 19, 2005, 01:22:28 PM »
The agreesubmit() statement stands for tracking the element ID which the user has customized from his agreement terms text as it would be poped-out with a message ' if ' the user has not checked the box by reading those terms.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Visitor should agree to the terms and conditions, but how?
« Reply #9 on: July 19, 2005, 02:48:54 PM »
then I see no reference to that function. Functions are useless until they being called somewhere ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

TheOracle

  • Guest
Re: Visitor should agree to the terms and conditions, but how?
« Reply #10 on: July 19, 2005, 04:15:57 PM »
I found these functions from this site :

http://www.dynamicdrive.com/dynamicindex16/acceptterm.htm

Which is where, I found the additional function.

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Visitor should agree to the terms and conditions, but how?
« Reply #11 on: July 19, 2005, 05:58:34 PM »
Yes Vano, that is exactly what I'm talking about. Pretty simple, actually. I will definately try this out :!:
Greetz: Lasse

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Visitor should agree to the terms and conditions, but how?
« Reply #12 on: July 22, 2005, 01:37:35 AM »
but you still don't understand what I mean.
TheOracle's method is the easiest one and IMO aficient one. But I'm not sure what agreesubmit() function does...

Basicaly all u need is the step 2 (step 1 is not needed), but replace that line with this:
Code: [Select]
<script language="javascript">
  function defaultagree(f)
  {
    if (f.terms.checked)
    {
      return true;
    }
    alert("Please read/accept terms before uploading to {site_name}")
    return false
  }
</script>

<form method="post" action="{url_member}" enctype="multipart/form-data" onsubmit="if (defaultagree(this)) uploadbutton.disabled=true; else return false">

and also u'll need add your checkbox in that template:
Code: [Select]
        <input type="checkbox" name="terms" value="1"> terms

Thanks, it works.
Greetz: Lasse

Offline cookie

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Visitor should agree to the terms and conditions, but how?
« Reply #13 on: September 25, 2009, 03:31:31 AM »
Thanks for posting this.

I found this to be very valuable.