<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to handle unchecking a checkbox error? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-handle-unchecking-a-checkbox-error/m-p/640727#M83804</link>
    <description>&lt;P&gt;If you want user to select only one option, use radio box or combo box instead of check box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use check box, remove the index and add check for length of the list&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
New Window( "Example",
	cb = Check Box(
		{"Max", "Median", "Min", "Mean", "Std Dev"},
		returned = (cb &amp;lt;&amp;lt; Get Selected ());
		If(N Items(returned) &amp;gt;= 1,
			show(returned);
			show(returned[1]);
		);	
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Jun 2023 12:43:26 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-06-09T12:43:26Z</dc:date>
    <item>
      <title>How to handle unchecking a checkbox error?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-handle-unchecking-a-checkbox-error/m-p/640718#M83803</link>
      <description>&lt;P&gt;I want the user to select only one item using the following e.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
New Window( "Example",
	cb = Check Box(
		{"Max", "Median", "Min", "Mean", "Std Dev"},
		returned = (cb &amp;lt;&amp;lt; Get Selected ())[1];
		Print( returned ) //{"Mean", "Std Dev"} or etc
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above works, but if the user checks and then unchecks the checked box, JMP throws an error as it can no longer execute&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;returned = (cb &amp;lt;&amp;lt; Get Selected ())[1];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How to handle this by perhaps showing a dialog to the user saying that "user must select only option to proceed"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, is it possible to start with a check box already checked? If so, how?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:55:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-handle-unchecking-a-checkbox-error/m-p/640718#M83803</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-06-09T23:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle unchecking a checkbox error?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-handle-unchecking-a-checkbox-error/m-p/640727#M83804</link>
      <description>&lt;P&gt;If you want user to select only one option, use radio box or combo box instead of check box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use check box, remove the index and add check for length of the list&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
New Window( "Example",
	cb = Check Box(
		{"Max", "Median", "Min", "Mean", "Std Dev"},
		returned = (cb &amp;lt;&amp;lt; Get Selected ());
		If(N Items(returned) &amp;gt;= 1,
			show(returned);
			show(returned[1]);
		);	
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 12:43:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-handle-unchecking-a-checkbox-error/m-p/640727#M83804</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-06-09T12:43:26Z</dc:date>
    </item>
  </channel>
</rss>

