<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Where to add the JQuery code</title>
		<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code</link>
		<description>Gravity Support Forums Topic: Where to add the JQuery code</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 18:47:52 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/where-to-add-the-jquery-code" rel="self" type="application/rss+xml" />

		<item>
			<title>gcollignon on "Where to add the JQuery code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code#post-56569</link>
			<pubDate>Wed, 25 Apr 2012 17:28:23 +0000</pubDate>
			<dc:creator>gcollignon</dc:creator>
			<guid isPermaLink="false">56569@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Rob, I saw the working example but if I change the number to 4 I am still limited only to check 3 checkboxes. I was thinking on adding a dropdown with the number. I'd like to explain the reason why I am trying to do this, I am building an &#34;order Pizza&#34; the problem is that there are so many variations. Like first number of pizzas to order, second each pizza can be different then each one has a different price after that you need to select the number of ingredients (each extra ingredient also costs extra but it is a different price depending on the size of pizza) Now here where I ma using the limit checkboxes I am adding a dropdown asking for the number of ingredients and once they select the number then they will only be able to check those boxes. 4 ingredients will only allow them to select 4 checkboxes. Which takes me to the next problem every ingredient can be on the right half, the left half or the whole pizza. If one is selected as half then they have the right to add another half (it has been a nightmare for me honestly)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rob Harrell on "Where to add the JQuery code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code#post-56543</link>
			<pubDate>Wed, 25 Apr 2012 15:27:57 +0000</pubDate>
			<dc:creator>Rob Harrell</dc:creator>
			<guid isPermaLink="false">56543@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;OK, so to do this, add your number field and give it a default value in the Advanced Tab of the field (you can then set this to be admin only for visibility). Find the ID of each field (on the number input and the dropdown ul by inspecting your form code).&#60;/p&#62;
&#60;p&#62;Your resulting jQuery would be this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;jQuery.noConflict();
  jQuery(document).ready(function($) {
	value = $(&#38;quot;#input_85_1&#38;quot;).val();
 	$.fn.limit = function(n) {
 	var self = this;
 	this.click(function(){ return (self.filter(&#38;quot;:checked&#38;quot;).length&#38;lt;=n); });
	}
	$(&#38;quot;ul#input_85_2 li input:checkbox&#38;quot;).limit(value);  				

  });&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;See this &#60;a href=&#34;http://www.evernote.com/shard/s212/sh/81533a60-0e4d-45fe-8d47-b48845c603c8/386f4933699374e924111c9c50ff35f7&#34; rel=&#34;nofollow&#34;&#62;Screenshot&#60;/a&#62; to show you how to find IDs. This is using Google Chrome Developer Tools, which is built-in to the browser. So in the jQuery above you would just replace the value line with the number field ID and then the second ul ID further down with the checkboxes ID.&#60;/p&#62;
&#60;p&#62;You can see a working example &#60;a href=&#34;http://dev.outerhavenstudios.com/limit-form/&#34; rel=&#34;nofollow&#34;&#62;here&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Where to add the JQuery code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code#post-56541</link>
			<pubDate>Wed, 25 Apr 2012 15:18:10 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">56541@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm sorry, I'm not a JavaScript expert by any means. As for finding out the ID, if you view the source of your form, it should show up as a class that you can then grab and put into your script.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gcollignon on "Where to add the JQuery code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code#post-56536</link>
			<pubDate>Wed, 25 Apr 2012 14:51:58 +0000</pubDate>
			<dc:creator>gcollignon</dc:creator>
			<guid isPermaLink="false">56536@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;BTW Is there a post that talks about how to find the &#34;input_1_15&#34; where do I get this from?&#60;/p&#62;
&#60;p&#62;Thanks again
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gcollignon on "Where to add the JQuery code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code#post-56535</link>
			<pubDate>Wed, 25 Apr 2012 14:45:15 +0000</pubDate>
			<dc:creator>gcollignon</dc:creator>
			<guid isPermaLink="false">56535@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is wonderful thanks, I have another question if you could please help me, In this same code can the limit # be variable. I mean can I create a drop down field with numbers and the number on that field is the limit #. How would that work?&#60;/p&#62;
&#60;p&#62;I was thinking something like this:&#60;/p&#62;
&#60;p&#62;&#38;lt;script type=&#34;text/javascript&#34;&#38;gt;&#60;br /&#62;
jQuery.noConflict();&#60;br /&#62;
  jQuery(document).ready(function($) {&#60;br /&#62;
    $.fn.limit = function(n) {&#60;br /&#62;
    var self = this;&#60;br /&#62;
    this.click(function(){ return (self.filter(&#34;:checked&#34;).length&#38;lt;=n); });&#60;br /&#62;
    }&#60;br /&#62;
    $(&#34;ul#input_1_15 li input:checkbox&#34;).limit(&#34;ul#input_1_15 li input:select&#34;);&#60;br /&#62;
  });&#60;br /&#62;
&#38;lt;/script&#38;gt;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Kevin Flahaut on "Where to add the JQuery code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code#post-56500</link>
			<pubDate>Wed, 25 Apr 2012 10:20:00 +0000</pubDate>
			<dc:creator>Kevin Flahaut</dc:creator>
			<guid isPermaLink="false">56500@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;David's on the money as always.. this might help for future reference as well.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Where to add the JQuery code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code#post-56498</link>
			<pubDate>Wed, 25 Apr 2012 10:08:02 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">56498@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You'll be looking to add it to the header of your theme file. Making sure to change the input_1_15 li to target the input number of your checkbox that you want to control.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gcollignon on "Where to add the JQuery code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-to-add-the-jquery-code#post-56496</link>
			<pubDate>Wed, 25 Apr 2012 10:05:34 +0000</pubDate>
			<dc:creator>gcollignon</dc:creator>
			<guid isPermaLink="false">56496@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi I would like to use Kevin´s solutions to this post &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/limiting-the-amount-of-checkboxes-that-can-be-checked&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/limiting-the-amount-of-checkboxes-that-can-be-checked&#60;/a&#62; can someone please help me telling me how and where to add the code he provided?&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
