<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Limiting Checkbox and Radio Button Choices</title>
	<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/</link>
	<description>smart business solutions</description>
	<pubDate>Wed, 19 Nov 2008 23:15:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1309</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Wed, 24 Sep 2008 15:55:24 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1309</guid>
		<description>ZSmith:

1: If you mean you want the link to change color as you click on it, I don't think its possible in any straight forward way. If you mean its color should be different after you have clicked it, then you can do this with Conditional Formatting. You just need some way to keep track of whether or not the link has been clicked. This could be done with a global variable, a value stored in a field somewhere, etc... 

For example, when they click the button, you could run a script that sets a variable called $$link_clicked to true, and then go to the layout. Then apply conditional formatting to the button with a condition formula of:

   $$link_clicked

And apply an alternate text color. Should work just fine.

2: For your radio buttons, you just need to set the value in the field to the current user's name, which you can get from the Get(AccountName) function. You can put this in an auto-enter calculation, or set the field with a script.

Hope this helps :)

Geoff</description>
		<content:encoded><![CDATA[<p>ZSmith:</p>
<p>1: If you mean you want the link to change color as you click on it, I don&#8217;t think its possible in any straight forward way. If you mean its color should be different after you have clicked it, then you can do this with Conditional Formatting. You just need some way to keep track of whether or not the link has been clicked. This could be done with a global variable, a value stored in a field somewhere, etc&#8230; </p>
<p>For example, when they click the button, you could run a script that sets a variable called $$link_clicked to true, and then go to the layout. Then apply conditional formatting to the button with a condition formula of:</p>
<p>   $$link_clicked</p>
<p>And apply an alternate text color. Should work just fine.</p>
<p>2: For your radio buttons, you just need to set the value in the field to the current user&#8217;s name, which you can get from the Get(AccountName) function. You can put this in an auto-enter calculation, or set the field with a script.</p>
<p>Hope this helps <img src='http://sixfriedrice.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Geoff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ZSmith</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1305</link>
		<dc:creator>ZSmith</dc:creator>
		<pubDate>Tue, 23 Sep 2008 20:20:34 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1305</guid>
		<description>I would like to know if the following is possible? Im new to fm


I created a link between two layouts and I would like the link to change colors when it is selected. How do I achieve this affect in FP9?

I also have three radiobuttons which contain names. I would like to know if its possible to automatically select the correct radio button if the user name that logins matches one of the names in the radio button selection?</description>
		<content:encoded><![CDATA[<p>I would like to know if the following is possible? Im new to fm</p>
<p>I created a link between two layouts and I would like the link to change colors when it is selected. How do I achieve this affect in FP9?</p>
<p>I also have three radiobuttons which contain names. I would like to know if its possible to automatically select the correct radio button if the user name that logins matches one of the names in the radio button selection?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Smith</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1148</link>
		<dc:creator>Alan Smith</dc:creator>
		<pubDate>Wed, 28 May 2008 06:57:49 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1148</guid>
		<description>Disregard my last comment. The issue I was having seems to be when the field is in a portal. Suggestions?</description>
		<content:encoded><![CDATA[<p>Disregard my last comment. The issue I was having seems to be when the field is in a portal. Suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Smith</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1147</link>
		<dc:creator>Alan Smith</dc:creator>
		<pubDate>Wed, 28 May 2008 06:16:40 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1147</guid>
		<description>Great solution. Is there a solution for a number field? For example: Radio buttons: (0,1,2)</description>
		<content:encoded><![CDATA[<p>Great solution. Is there a solution for a number field? For example: Radio buttons: (0,1,2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1002</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Sat, 05 Apr 2008 17:51:22 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1002</guid>
		<description>@nkhil: I'm not exactly sure what you mean. I'm guessing you have a checkbox field, and a button on your layout. You want a click on the button to uncheck two of the checkboxes. Is that right?

If you want the button to clear &lt;em&gt;all&lt;/em&gt; of the checkboxes, that's a breeze. Just clear the field. For instance, if your checkbox field is called &lt;code&gt;Colors&lt;/code&gt; then you can use this simple step:

&lt;pre&gt;&lt;code&gt;Set Field [ Colors; "" ]&lt;/code&gt;&lt;/pre&gt;

If the field has several checkboxes, and you want to clear just two specific values, then it gets a little more complex. As mentioned in the article, FileMaker stores the data in the field with each checkbox value on one line. So you need to find a way to remove specific lines of text from the field. You can do this with the &lt;code&gt;Substitute&lt;/code&gt; function. For instance, if you want to uncheck &lt;code&gt;Red&lt;/code&gt; and &lt;code&gt;Blue&lt;/code&gt; from your &lt;code&gt;Colors&lt;/code&gt; field, you could essentially do this:

&lt;pre&gt;&lt;code&gt;Set Field [ Colors; Substitute(Colors, "Red", "") ]
Set Field [ Colors; Substitute(Colors, "Blue", "") ]&lt;/code&gt;&lt;/pre&gt;

That two-line script says to replace the word "Red" in the field with nothing, and then do the same with "Blue".

First, you can streamline this a little if you want by doing both substitutions in one step, like this:

&lt;pre&gt;&lt;code&gt;Set Field [ Colors; Substitute(Colors; ["Red", ""]; ["Blue", ""]) ]&lt;/code&gt;&lt;/pre&gt;

The &lt;code&gt;Substitute&lt;/code&gt; function lest you pass in multiple pairs like this, and it will replace them all. 

But you also have another problem. Suppose your &lt;code&gt;Colors&lt;/code&gt; field has these values:

&lt;pre&gt;&lt;code&gt;Red
Green
Blue
Blueish&lt;/code&gt;&lt;/pre&gt;

When your script removes the word "Blue" from this value, it will find it in two places ("Blue" and the first part of "Blueish"). If this is a problem for your data set, you'll have to protect against it. You only want to replace "Blue" when it is on a line all by itself. In other words, when there is an ¶ right before it and another ¶ right after it. So you can &lt;em&gt;almost&lt;/em&gt; get away with this:

&lt;pre&gt;&lt;code&gt;Set Field [ Colors; Substitute(Colors, "¶Blue¶", "¶") ]&lt;/code&gt;&lt;/pre&gt;

This version says to replace "Blue" when it is preceded and followed by new lines with a single return, effectively wiping it out. But this version is &lt;em&gt;still&lt;/em&gt; not quite right. What if "Blue" is the &lt;em&gt;first&lt;/em&gt; item in the list? Then it won't have an ¶ before it. Likewise, if it is the last item, it won't have one after it. So you have to get creative: force your data into the form you want, do the substitution, and then clean it up when your done. This script does just that:

&lt;pre&gt;&lt;code&gt;Set Field [ Colors, ¶ &#038; Colors &#038; ¶ ]
Set Field [ Colors, Substitute(Colors; "¶Blue¶" "¶") ]
Set Field [ Colors, Substitute(Colors; "¶Red¶", "¶") ]
Set Field [ Colors, Middle(Colors, 2, Length(Colors) - 1) ]
&lt;/code&gt;&lt;/pre&gt;

As before, this script could be written in fewer steps if you want (in fact, it can be written in &lt;em&gt;one&lt;/em&gt; step) but I wanted the steps to be explicit here.

Hope this helps.

Geoff</description>
		<content:encoded><![CDATA[<p>@nkhil: I&#8217;m not exactly sure what you mean. I&#8217;m guessing you have a checkbox field, and a button on your layout. You want a click on the button to uncheck two of the checkboxes. Is that right?</p>
<p>If you want the button to clear <em>all</em> of the checkboxes, that&#8217;s a breeze. Just clear the field. For instance, if your checkbox field is called <code>Colors</code> then you can use this simple step:</p>
<pre><code>Set Field [ Colors; "" ]</code></pre>
<p>If the field has several checkboxes, and you want to clear just two specific values, then it gets a little more complex. As mentioned in the article, FileMaker stores the data in the field with each checkbox value on one line. So you need to find a way to remove specific lines of text from the field. You can do this with the <code>Substitute</code> function. For instance, if you want to uncheck <code>Red</code> and <code>Blue</code> from your <code>Colors</code> field, you could essentially do this:</p>
<pre><code>Set Field [ Colors; Substitute(Colors, "Red", "") ]
Set Field [ Colors; Substitute(Colors, "Blue", "") ]</code></pre>
<p>That two-line script says to replace the word &#8220;Red&#8221; in the field with nothing, and then do the same with &#8220;Blue&#8221;.</p>
<p>First, you can streamline this a little if you want by doing both substitutions in one step, like this:</p>
<pre><code>Set Field [ Colors; Substitute(Colors; ["Red", ""]; ["Blue", ""]) ]</code></pre>
<p>The <code>Substitute</code> function lest you pass in multiple pairs like this, and it will replace them all. </p>
<p>But you also have another problem. Suppose your <code>Colors</code> field has these values:</p>
<pre><code>Red
Green
Blue
Blueish</code></pre>
<p>When your script removes the word &#8220;Blue&#8221; from this value, it will find it in two places (&#8221;Blue&#8221; and the first part of &#8220;Blueish&#8221;). If this is a problem for your data set, you&#8217;ll have to protect against it. You only want to replace &#8220;Blue&#8221; when it is on a line all by itself. In other words, when there is an ¶ right before it and another ¶ right after it. So you can <em>almost</em> get away with this:</p>
<pre><code>Set Field [ Colors; Substitute(Colors, "¶Blue¶", "¶") ]</code></pre>
<p>This version says to replace &#8220;Blue&#8221; when it is preceded and followed by new lines with a single return, effectively wiping it out. But this version is <em>still</em> not quite right. What if &#8220;Blue&#8221; is the <em>first</em> item in the list? Then it won&#8217;t have an ¶ before it. Likewise, if it is the last item, it won&#8217;t have one after it. So you have to get creative: force your data into the form you want, do the substitution, and then clean it up when your done. This script does just that:</p>
<pre><code>Set Field [ Colors, ¶ &#038; Colors &#038; ¶ ]
Set Field [ Colors, Substitute(Colors; "¶Blue¶" "¶") ]
Set Field [ Colors, Substitute(Colors; "¶Red¶", "¶") ]
Set Field [ Colors, Middle(Colors, 2, Length(Colors) - 1) ]
</code></pre>
<p>As before, this script could be written in fewer steps if you want (in fact, it can be written in <em>one</em> step) but I wanted the steps to be explicit here.</p>
<p>Hope this helps.</p>
<p>Geoff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nikhil</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1001</link>
		<dc:creator>nikhil</dc:creator>
		<pubDate>Sat, 05 Apr 2008 16:50:28 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-1001</guid>
		<description>what will the code to remove two check box on clicking a buttton  run time.</description>
		<content:encoded><![CDATA[<p>what will the code to remove two check box on clicking a buttton  run time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manuel Klimis</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-991</link>
		<dc:creator>Manuel Klimis</dc:creator>
		<pubDate>Thu, 20 Mar 2008 17:56:48 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-991</guid>
		<description>Very good, nice , thank you, great service.</description>
		<content:encoded><![CDATA[<p>Very good, nice , thank you, great service.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-928</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Thu, 03 Jan 2008 00:24:39 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-928</guid>
		<description>@tom: You absolutely can. Under the hood, a radio button field is just a normal field. When you click one of the radio buttons, FileMaker "types" the associated value into the field. So to get what you want, just use the &lt;em&gt;Data&lt;/em&gt; option in the Auto Enter section when setting up your field.

For instance, if your value list items are "Windows" and "Mac," put "Windows" in the Data box. Now whenever a new record is created, the field will get "Windows" plugged in, and that radio button will show as selected.

Geoff</description>
		<content:encoded><![CDATA[<p>@tom: You absolutely can. Under the hood, a radio button field is just a normal field. When you click one of the radio buttons, FileMaker &#8220;types&#8221; the associated value into the field. So to get what you want, just use the <em>Data</em> option in the Auto Enter section when setting up your field.</p>
<p>For instance, if your value list items are &#8220;Windows&#8221; and &#8220;Mac,&#8221; put &#8220;Windows&#8221; in the Data box. Now whenever a new record is created, the field will get &#8220;Windows&#8221; plugged in, and that radio button will show as selected.</p>
<p>Geoff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom R.</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-927</link>
		<dc:creator>Tom R.</dc:creator>
		<pubDate>Wed, 02 Jan 2008 23:39:23 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-927</guid>
		<description>Cool advice. 

I was wondering if you could do something similar to auto-enter a radio button value when creating a new record. 90% of the records in my db will have one particular value, and I'd like to have it auto entered. that way you only have to click a radio button for the small 10% minority of records.</description>
		<content:encoded><![CDATA[<p>Cool advice. </p>
<p>I was wondering if you could do something similar to auto-enter a radio button value when creating a new record. 90% of the records in my db will have one particular value, and I&#8217;d like to have it auto entered. that way you only have to click a radio button for the small 10% minority of records.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rene</title>
		<link>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-553</link>
		<dc:creator>Rene</dc:creator>
		<pubDate>Sun, 16 Sep 2007 23:13:04 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/limiting-checkbox-and-radio-button-choices/#comment-553</guid>
		<description>The shift key can also be used to deselect any value in a radio button field. Just hold the shift key and click on an already selected radio button and the selection gets deselected. There seems to be many people ignoring that...</description>
		<content:encoded><![CDATA[<p>The shift key can also be used to deselect any value in a radio button field. Just hold the shift key and click on an already selected radio button and the selection gets deselected. There seems to be many people ignoring that&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
