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.

Add a link within a checkbox

  1. I have added a checkbox to a form, and the field label says "I have read legal notice" how can I link 'legal notice' to the legal notice page? How can I add a link?
    Thanks

    Posted 12 years ago on Monday July 4, 2011 | Permalink
  2. HTML isn't supported within the labels, but you can add the link using jQuery. You can find an example here.

    http://www.gravityhelp.com/forums/topic/how-to-add-hyperlinks-in-the-form#post-6838

    Posted 12 years ago on Monday July 4, 2011 | Permalink
  3. hi Kevin

    and where exactly do I paste that code?

    Thanks!

    Posted 12 years ago on Monday July 4, 2011 | Permalink
  4. See the section on jQuery/Javascript here for placement info

    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Posted 12 years ago on Monday July 4, 2011 | Permalink
  5. So I have pasted this http://www.pastie.org/2163913 to a file called custom.js within a js folder of our theme. Then I go back to the form ID #2 on form dashboard and edit, and what should I do then?

    Posted 12 years ago on Monday July 4, 2011 | Permalink
  6. You need to make sure the custom.js file is properly referenced in the theme header.php file so it gets loaded on the page. You also want to make sure this get's loaded AFTER the jQuery library itself gets loaded so you could put the script reference just before the </head> tag to be safe.

    http://codex.wordpress.org/Using_Javascript
    http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    Posted 12 years ago on Monday July 4, 2011 | Permalink
  7. Hi Kevin
    I don't see any reference to javascript on theme's header.php but it might probably be bcs I don't get it since I am not a coder. I am just a gravity forms user who would like to have a link to TOS in a checkbox. But since it's this complicated, I'll forget about it. Thank you.

    Posted 12 years ago on Tuesday July 5, 2011 | Permalink
  8. Elena,

    If you'd like to post a URL to your form page I can take a look and help you hook everything up. I shouldn't be a big deal.

    Posted 12 years ago on Tuesday July 5, 2011 | Permalink
  9. Hi Kevin
    Thanks a lot. Website is on maintenance mode for the public so unless I give you admin access, there won't be a way to see the form page. Is that ok with you? And if so, where should I send the admin/pass details to?
    E.

    Posted 12 years ago on Tuesday July 5, 2011 | Permalink
  10. Elena,

    You can send the info to me at kevin@rocketgenius.com

    Please reference this topic URL as well so I can refer back to it if needed. I forget things like that sometimes.. :)

    Posted 12 years ago on Tuesday July 5, 2011 | Permalink
  11. I just have, thanks!

    Posted 12 years ago on Tuesday July 5, 2011 | Permalink
  12. Elena,

    A couple of things.. you don't need to include the opening/closing script tags since the custom.js file is already reference/loaded on the page and enclosed in those. Also, I looked at your form, and the class name of the label you were trying to change was different than what you had in the code.

    That said, try replacing the entire contents of your custom.js file with this..

    http://pastie.org/2169852

    Before you do, I'd back up the original file just to be on the safe side. I always prefer to have a good backup in case anything happens.

    Give it a shot and see if that works for you.

    Posted 12 years ago on Wednesday July 6, 2011 | Permalink
  13. Hi Kevin
    Thank you. I have backed up custom.js and added yours. Nothing is broken but still, what am I supposed to do so that in here http://cl.ly/3d0X08170r1U3H3x1H42 the link appears?
    http://cl.ly/2f0e3e2i0E0W0L181t2V

    Posted 12 years ago on Wednesday July 6, 2011 | Permalink
  14. Okay, I see what it is. We need to re-order the code a little. Go ahead and replace the current custom.js contents with this.

    http://pastie.org/2172705

    It worked as intended in my test.

    screenshot: http://bit.ly/qn89ZQ

    Posted 12 years ago on Wednesday July 6, 2011 | Permalink
  15. Lucky you Kevin!
    I've just replaced old custom.js with your new custom.js and bad luck: no magic.
    :S

    Posted 12 years ago on Wednesday July 6, 2011 | Permalink
  16. Elena,

    Sorry it took me a while to come back to this but I just visited the page and I see the link working properly. I'm assuming I'm looking at the correct form.

    http://cirugiaesteticamasculina.com/pide-cita/

    screenshot: http://bit.ly/pMG8RF

    I had added a custom link style in my previous test just so it would show up better. Your default link style is dark and doesn't stand out much so that may be why you're missing it.

    Posted 12 years ago on Thursday July 7, 2011 | Permalink
  17. Haha, nope, it wasn't showing. I would have noticed it, even if black :D Now I see it, I think it was a cache issue! So finally, great, thank you very much Kevin.

    Posted 12 years ago on Thursday July 7, 2011 | Permalink
  18. Yeah, I thought it might be a cache issue as well. Either way, I'm glad it's working for you now. Let us know if you need anything else.

    Posted 12 years ago on Thursday July 7, 2011 | Permalink

This topic has been resolved and has been closed to new replies.