PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

terms & conditions in form

  1. PCN
    Member

    Hi

    I'm trying to create a from with a checkbox to agree to terms and conditions in a form using the below code

    jQuery(document).ready(function() {
     		jQuery(".gchoice_5_1 label").html('I have read and agree to the <a href="http://www.google.com/accounts/TOS" rel="nofollow">terms and conditions</a>');
    	});

    But I don't know where to put this code and can't get this working, could anyone give a detailed explanation on how to get this to work

    Posted 13 years ago on Wednesday February 2, 2011 | Permalink
  2. I absolutely need this functionality too.

    I haven't tried with jQuery, but I can see no good reason for Gravity Forms to mess up the HTML I insert in the checbkox label. Why have you chosen to do it this way, guys? Can't you just interpret HTML so that we can create a terms & conditions function with no hassle?

    I would love to hear back from you on this.

    Eivind

    Posted 13 years ago on Tuesday March 1, 2011 | Permalink
  3. @Dave Lee The code would go in your theme template file that is used for the page that is displaying your form.

    @SigarettDesign the reason Gravity Forms does not currently allow HTML in the checkbox label is because the checkbox label is used in the Entry List screen as a column header and HTML could cause UI issues if used in that field due to how the labels are output and utilized in the admin.

    Not to mention placing HTML in labels can disrupt the form builder, it would be easy for the user to place code in them that would cause UI issues in the form builder and admin the way it is currently working.

    We do plan on implementing the ability to use HTML in labels, however we need to hold off until we have time to devote to implementing it properly. We can't just stop stripping HTML from these fields because it would cause major problems in the admin if we did so. We have to make sure the form builder, entry list page, etc. handles it properly. Most likely the HTML will have to be stripped out when displayed in these areas.

    The problem is if all the label contains is HTML, then there is nothing to display if we strip the HTML. So it's not as simple as it may sound. We plan on finding the best way to handle it but we aren't going to rush it into the plugin as a feature until we do so. I

    Posted 13 years ago on Tuesday March 1, 2011 | Permalink
  4. Thanks for the info, Carl.

    While I'm waiting for the HTML in labels feature, how do you recommend I implement a terms & conditions checkbox function. Like did Dave above?

    Cheers,
    Eivind

    Posted 13 years ago on Tuesday March 1, 2011 | Permalink
  5. What Dave has done above should work if implemented properly. It can be done with jQuery as he has outlined and there are other examples on the forum of similar implementations.

    Another option is if you are using the 1.5 development release you can use a Section Break field for the Terms and Conditions and apply the scroll text Ready Class to that Section Break. That will display your Terms and Conditions are a scrollable area on your form. Then you add the Checkbox field below it and ask them to agree to those terms and conditions.

    Posted 13 years ago on Tuesday March 1, 2011 | Permalink
  6. Your suggested implementation sounds interesting, Carl.

    Please tell me more about the "scroll text Ready Class". I can only see plain text input of classes in the section break and the class name you gave me isn't valid CSS.

    Cheers,
    Eivind

    Posted 13 years ago on Wednesday March 2, 2011 | Permalink
  7. http://www.gravityhelp.com/documentation/css-ready-classes/

    NOTE: the Ready Class styles are only in the 1.5 RC version (available on the downloads page). If you don't want to upgrade to the 1.5 release candidate version right now, you can copy the ready class styles from the link below and add those to your theme stylesheet. Then you can apply the classes to your field as described in the documentation.

    Ready Class CSS: http://pastie.org/1443282

    Posted 13 years ago on Wednesday March 2, 2011 | Permalink
  8. Thanks, Kevin,

    I was first confused by the section break. I asked myself how I was going to get content into it - tried dragging an HTML box over it. Then I realized I was supposed to use the "description" field. That name makes little sense to me. Shouldn't it be "content"?

    I got it working now. Cheers

    Posted 13 years ago on Wednesday March 2, 2011 | Permalink
  9. I'm glad it's working for you.

    The description field is intended to be exactly that, a description for the section & content that follows. You can use it for other content as we've mentioned, but it's named to reflect its primary purpose.

    Posted 13 years ago on Wednesday March 2, 2011 | Permalink