<?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: Save values in text edit box in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40939#M23892</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dlg = New Window( "Enter Many Numbers", &amp;lt;&amp;lt; Modal,
	Outline Box( "Data Entry",
		Table Box(
			String Col Box( "Variable", { "a", "b", "c", "d", "e" } ),
			nceb = Number Col Edit Box( "Value", J( 5, 1, . ) )
		)
	),
	H List Box(
		Button Box( "OK",
			input = nceb &amp;lt;&amp;lt; Get As Matrix;
		),
		Button Box( "Cancel" )
	)
);

If( dlg["Button"] == -1,
	Throw( "User cancelled" );
);

// Do something with input values&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Jun 2017 12:59:59 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2017-06-21T12:59:59Z</dc:date>
    <item>
      <title>Save values in text edit box</title>
      <link>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40869#M23859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If I have a window, such as the one below, and the user enters some values in the text boxes. How could I save these numerical values into an array? For example, if someone typed in 1, 2, 3 ,and 4 into the text boxes, when they press OK, I would like these values to be saved into an array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;new window("test",
	text edit box(""),
	text edit box(""),
	text edit box(""),
	text edit box(""),
        button box("OK");
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Button.PNG" style="width: 144px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/6522i4F07898D1F7BC6DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Button.PNG" alt="Button.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 21:21:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40869#M23859</guid>
      <dc:creator>matt7109</dc:creator>
      <dc:date>2017-06-20T21:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Save values in text edit box</title>
      <link>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40904#M23862</link>
      <description>&lt;P&gt;You need to add a script argument to your &lt;FONT face="courier new,courier"&gt;&lt;A href="http://www.jmp.com/support/help/Display.shtml" target="_self"&gt;Button Box()&lt;/A&gt;&lt;/FONT&gt;. It will collect the values from the text edit boxes and close the window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw = New Window( "test",
	a = Text Edit Box( "" ),
	b = Text Edit Box( "" ),
	c = Text Edit Box( "" ),
	d = Text Edit Box( "" ),
	Button Box( "OK",
		foo = Eval List(
			{a &amp;lt;&amp;lt; get text, b &amp;lt;&amp;lt; get text, c &amp;lt;&amp;lt; get text, d &amp;lt;&amp;lt;get text}
		);
		nw &amp;lt;&amp;lt; close window;
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Jun 2017 21:31:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40904#M23862</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2017-06-20T21:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Save values in text edit box</title>
      <link>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40905#M23863</link>
      <description>&lt;P&gt;In addition to Jeff's answer, you should consider other display boxes. A &lt;EM&gt;Text Edit Box&lt;/EM&gt; is a fine and versatile input object but there are others that are more specialized for a given purpose, If you expect a numeric value, consider a &lt;EM&gt;Number Edit Box&lt;/EM&gt;. If you expect multiple, possibly related numeric values, then consider a &lt;EM&gt;Number Col Edit Box&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;You should definitely consider reading the JSL guide about constructing windows, dialogs in particular. See &lt;STRONG&gt;Help&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Books&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Scripting&lt;/STRONG&gt; &lt;STRONG&gt;Guide&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 22:18:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40905#M23863</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2017-06-20T22:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Save values in text edit box</title>
      <link>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40935#M23888</link>
      <description>&lt;P&gt;Thank you! If there was a much larger number of boxes, is there any way to automate this using a loop rather than an a, b, c, and d?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 12:31:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40935#M23888</guid>
      <dc:creator>matt7109</dc:creator>
      <dc:date>2017-06-21T12:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Save values in text edit box</title>
      <link>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40937#M23890</link>
      <description>&lt;P&gt;If you use a &lt;EM&gt;Number Col Edit Box&lt;/EM&gt; instead of individual &lt;EM&gt;Text Edit Box&lt;/EM&gt; objects, then your button script can send the message &lt;STRONG&gt;Get As Matrix&lt;/STRONG&gt; to return all of them as a column vector.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 13:01:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40937#M23890</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2017-06-21T13:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Save values in text edit box</title>
      <link>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40938#M23891</link>
      <description>&lt;P&gt;You can place a &lt;EM&gt;String Col Box&lt;/EM&gt; to the left of the &lt;EM&gt;Number Col Edit Box&lt;/EM&gt; for labels if you like and enclose both of the columns in a &lt;EM&gt;Table Box&lt;/EM&gt; to neatly organize it.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 13:02:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40938#M23891</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2017-06-21T13:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Save values in text edit box</title>
      <link>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40939#M23892</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dlg = New Window( "Enter Many Numbers", &amp;lt;&amp;lt; Modal,
	Outline Box( "Data Entry",
		Table Box(
			String Col Box( "Variable", { "a", "b", "c", "d", "e" } ),
			nceb = Number Col Edit Box( "Value", J( 5, 1, . ) )
		)
	),
	H List Box(
		Button Box( "OK",
			input = nceb &amp;lt;&amp;lt; Get As Matrix;
		),
		Button Box( "Cancel" )
	)
);

If( dlg["Button"] == -1,
	Throw( "User cancelled" );
);

// Do something with input values&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jun 2017 12:59:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-values-in-text-edit-box/m-p/40939#M23892</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2017-06-21T12:59:59Z</dc:date>
    </item>
  </channel>
</rss>

