Results 1 to 10 of 10

Thread: "Accept" and move on

  1. #1
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default "Accept" and move on

    i simply want an "accept" check box before the user moves to the next page.

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mmacw
    i simply want an "accept" check box before the user moves to the next page.
    If you want this to be legally binding[1], this would have to be enforced reliably which means a client-side solution is completely out of the question. What server-side languages do you have at your disposal?

    Mike


    [1] I seem to remember doubts that an "accept" checkbox, or similar, can provide this on a website as it may be possible to skip straight past it.

    Disclaimer: I am not a lawyer.

  3. #3
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanx. i agree, just looking for new ideas.

    ron

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

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.

    Well, here's a modified example that doesn't disable the submit button directly, simply prevents the form from submitting if the checkbox isn't checked:

    Code:
    <script type="text/javascript">
    
    //"Accept terms" form submission- By Dynamic Drive
    //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
    //This credit MUST stay intact for use
    
    function defaultagree(el){
    var checkobj=el.agreecheck
    if (checkobj.checked)
    return true
    else{
    alert("Please read/accept terms to submit form")
    return false
    }
    }
    
    </script>
    
    <body>
    
    <form name="agreeform" onSubmit="return defaultagree(this)">
    Rest of your form here<br>
    <input name="agreecheck" type="checkbox"><b>I agree to the above terms</b><br>
    <input type="Submit" value="Submit!">
    </form>

  5. #5
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin
    Well, here's a modified example that doesn't disable the submit button directly
    Good. Disabling a form control via HTML creates a dependancy on client-side scripting which is never desirable on the Web.

    simply prevents the form from submitting if the checkbox isn't checked:
    But as I hypothesised, for a click-through agreement to have any basis in law it must meet certain criteria. Any client-side script can be disabled or subverted. For example, the demonstration used with the original Accept terms script can be bypassed using the following bookmarklet:

    Code:
    javascript:void(
      (document.forms['agreeform'].elements[2].disabled=false),
      (document.forms['agreeform'].onsubmit=null)
    );
    The line breaks are for readability only.

    If the first expression is removed (including the comma operator), it would apply to the code you presented, too.

    If the agreement was bypassed in such a way, it could be argued that the user didn't give their consent to the terms so they are not bound by any of the clauses set forth. Similarly, if the "protected" content can be accessed directly, that could be considered bypassing consent, too.

    This is a legal minefield and it definitely requires advice from a lawyer that's well versed in all the possible issues. However, I sincerely doubt that any client-side solution is viable. I'd strongly suggest that you state that clearly on the Accept terms script page.

    Mike

  6. #6
    Join Date
    Jan 2005
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    mwinter: client-side scripting can be used together with server side scripting to validate user's input in a more user-friendly way. In case if JS is disabled or some browser doesn't interpret it properly, server side code will return an error message. For the remaining 99% of cases, using JS will be less frustrating and more efficient.

    ddadmin: how about this:

    HTML Code:
    <script type="text/javascript">
    
    //Feel free to remove these 3 lines and give us no credit
    //Fpit http://www.financialpit.com
    //Need to fill this line since I said "3 lines" above
    
    function agreeornot(myel1,myel2){
    	var chobj1=myel1;
    	var chobj2=myel2;
    	if (chobj1.checked)
    		chobj2.disabled=0;
    	else{
    		chobj2.disabled=1;
    	}
    }
    
    </script>
    
    <body>
    
    <form name="agreeform">
    	Form goes here<br>
    	<input name="agcheck" type="checkbox" onclick="agreeornot(this,agreeform.mysubmit);"><b>I agree with everything above</b><br>
    	<input name="mysubmit" type="submit" value="Submit This Agreement" disabled>
    </form>

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by FPit
    client-side scripting can be used together with server side scripting
    I am well aware of that fact. However, the requirement of server involvement hasn't been stressed enough.

    For the remaining 99% of cases [where scripting is enabled]
    Common statistics place that percentage closer to 90%, though there will of course be variations based on the target audience. However, you're suggestion (using the disabled attribute) would make a page useless for those users that do have client-side scripting disabled.

    Code:
    function agreeornot(myel1,myel2){
    	var chobj1=myel1;
    	var chobj2=myel2;
    The addition of these two variables serve no purpose other than to bloat the code.

    Code:
    	if (chobj1.checked)
    		chobj2.disabled=0;
    	else{
    		chobj2.disabled=1;
    	}
    Code:
    chobj2.disabled = !chobj1.checked;
    would be far more efficient (once you use the arguments directly).

    HTML Code:
    	<input [...] disabled>
    Again, it is a very bad idea to use the disabled attribute on the Web as it forces involvement of client-side scripting when it really isn't necessary.

    Mike

  8. #8
    Join Date
    Jan 2005
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am well aware of that fact. However, the requirement of server involvement hasn't been stressed enough.
    I was not doubting your degree of awareness about this fact. I do believe however that the importance of server side requirement was overstressed.

    Common statistics place that percentage closer to 90%, though there will of course be variations based on the target audience.
    Even if it's 80%, it would still be useful to use JS to validate input immediately, and use PHP to do it for post vars.

    However, you're suggestion (using the disabled attribute) would make a page useless for those users that do have client-side scripting disabled.
    ...The addition of these two variables serve no purpose other than to bloat the code.
    ...would be far more efficient (once you use the arguments directly).
    Yes, it's true, I was illustrating the concept with generic code by comparing it to the previous code.

    Again, it is a very bad idea to use the disabled attribute on the Web as it forces involvement of client-side scripting when it really isn't necessary.
    True, the solution is to use JS to disable input onload.
    Last edited by FPit; 01-11-2005 at 09:21 PM.

  9. #9
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by FPit
    I was not doubting your degree of awareness about this fact. I do believe however that the importance of server side requirement was overstressed.
    Unless you have evidence to the contrary, it's my understanding that a click-through agreement must be reliable in its operation to have any basis in law. As this is only possible server-side, I don't see how this element of the process can be overstressed. Especially considering that I've been the only person to mention it.

    the solution is to use JS to disable input onload.
    The submit button shouldn't be disabled at all. If the user doesn't consent to the agreement, they should be redirected. Where depends on what you're doing.

    Mike

  10. #10
    Join Date
    Jan 2005
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I don't see how this element of the process can be overstressed.
    By repeatedly stressing and re-stating the point which noone argues with is overstressing. Moreover, the question was not about legal issues and click-through agreement, you have raised that subject and repeatedly re-stated it several times.

    Especially considering that I've been the only person to mention it.
    Yes, you are the only person to mention it, and I do believe there are reasons why others decided not to mention it. One of the reasons is because this does not answer the question, but rather gives a related suggestion which is obvious to the majority of people anyway. Another reason is because since you already stated it once, there is no need to re-state it or discuss it.

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
  •