<?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 How to get a &amp;quot;Get Text Changed&amp;quot; functionality for a TextEditBox in a JMP Application? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768636#M94888</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have found many helpful solutions here in the past, thank you for that. But now I have a question to which I have not yet found a solution.&lt;/P&gt;&lt;P&gt;I have a JMP Application with a TextEditBox and two TextBoxes. The TextBoxes are only for the visualisation of result. I want to trigger some action, depending on the current length of the text in this TextEditBox during the entering of the text. For JSL script, there is a function in the scripting index (GetTextChanged), but how could I get this functionality in the JMP Application?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I call the function "displ_txt()" with the "TextChanged" script in the object section of the TextEditBox and&amp;nbsp;tried the following in the Scripts Tab,&amp;nbsp;but it does not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I use JMP 18.0.0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;OnModuleLoad( {}, );

thisModuleInstance &amp;lt;&amp;lt; Create Objects;

displ_txt = Function( {},
	teb_txt = TextEdit1 &amp;lt;&amp;lt; GetText;
	Try( Text2 &amp;lt;&amp;lt; SetText( teb_txt ),"Error" );

	If( Length( teb_txt ) &amp;gt; 0,
		Show( Length( teb_txt ) )	//Here should be the current length after each change
	);
	//...what I want to do further is like
	If( Length( GetTextChanged( teb_txt ) ) &amp;lt;= 3,
		Text1 &amp;lt;&amp;lt; SetText( "Len below limit" ),
		Text1 &amp;lt;&amp;lt; SetText( "Len above limit" )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2024 14:24:20 GMT</pubDate>
    <dc:creator>NaivePlatypus29</dc:creator>
    <dc:date>2024-06-26T14:24:20Z</dc:date>
    <item>
      <title>How to get a "Get Text Changed" functionality for a TextEditBox in a JMP Application?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768636#M94888</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have found many helpful solutions here in the past, thank you for that. But now I have a question to which I have not yet found a solution.&lt;/P&gt;&lt;P&gt;I have a JMP Application with a TextEditBox and two TextBoxes. The TextBoxes are only for the visualisation of result. I want to trigger some action, depending on the current length of the text in this TextEditBox during the entering of the text. For JSL script, there is a function in the scripting index (GetTextChanged), but how could I get this functionality in the JMP Application?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I call the function "displ_txt()" with the "TextChanged" script in the object section of the TextEditBox and&amp;nbsp;tried the following in the Scripts Tab,&amp;nbsp;but it does not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I use JMP 18.0.0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;OnModuleLoad( {}, );

thisModuleInstance &amp;lt;&amp;lt; Create Objects;

displ_txt = Function( {},
	teb_txt = TextEdit1 &amp;lt;&amp;lt; GetText;
	Try( Text2 &amp;lt;&amp;lt; SetText( teb_txt ),"Error" );

	If( Length( teb_txt ) &amp;gt; 0,
		Show( Length( teb_txt ) )	//Here should be the current length after each change
	);
	//...what I want to do further is like
	If( Length( GetTextChanged( teb_txt ) ) &amp;lt;= 3,
		Text1 &amp;lt;&amp;lt; SetText( "Len below limit" ),
		Text1 &amp;lt;&amp;lt; SetText( "Len above limit" )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 14:24:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768636#M94888</guid>
      <dc:creator>NaivePlatypus29</dc:creator>
      <dc:date>2024-06-26T14:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a "Get Text Changed" functionality for a TextEditBox in a JMP Application?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768691#M94896</link>
      <description>&lt;P&gt;What are you trying to do with Get Text Changed? Get Text Changed returns you the function tied to the Text Edit Box's Set Text Changed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;displ_txt = Function( {},
	teb_txt = TextEdit1 &amp;lt;&amp;lt; GetText;
	Try( Text2 &amp;lt;&amp;lt; SetText( teb_txt ),"Not OK" );

	If( Length( teb_txt ) &amp;gt; 0,
		Show( Length( teb_txt ) )	//Here should be the current length after each change
	);
	//...what I want to do further is like
	If( Length(teb_txt) &amp;lt;= 3,
		Text1 &amp;lt;&amp;lt; SetText( "Len below limit" ),
		Text1 &amp;lt;&amp;lt; SetText( "Len above limit" )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1719422278421.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65591i2A1922D9A332D418/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1719422278421.png" alt="jthi_1-1719422278421.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There might be some weird behavior until you perform first commit (click outside text edit box or press enter).&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 17:19:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768691#M94896</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-26T17:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a "Get Text Changed" functionality for a TextEditBox in a JMP Application?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768695#M94898</link>
      <description>&lt;P&gt;how about &lt;FONT face="courier new,courier"&gt;script:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1719423445851.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65592i91C5DEB33B4A5AE3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1719423445851.png" alt="hogi_0-1719423445851.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whenever the users selects the text edit box and finishes there, &lt;FONT face="courier new,courier"&gt;script&lt;/FONT&gt; will be triggered.&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Script&lt;/FONT&gt; seems to be slightly "ahead" of &lt;FONT face="courier new,courier"&gt;Text Changed&lt;/FONT&gt;:&lt;BR /&gt;When you place displ_txt() there, it already returns the new length once the user finishes the entry - not 1 step later.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 17:41:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768695#M94898</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-06-26T17:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a "Get Text Changed" functionality for a TextEditBox in a JMP Application?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768698#M94899</link>
      <description>&lt;P&gt;This code should give you some ideas:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;filter_text = Function( {this, entered_txt},
	{msg},
	// only attempt to filter if there is any text
	If( entered_txt != "",
		if (length(entered_txt) &amp;lt;= 3,
			msg = "Len below limit",
			msg = "Len above limit"
		);
		message_tb &amp;lt;&amp;lt; set text(msg);
	);
);		// end filter_text function

nw = new window("Test String Length",
	user_tb = textedit box("",
			&amp;lt;&amp;lt; set text changed(filter_text)),
	message_tb = text box("")
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jun 2024 17:49:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768698#M94899</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2024-06-26T17:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a "Get Text Changed" functionality for a TextEditBox in a JMP Application?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768851#M94915</link>
      <description>&lt;P&gt;Thank you for your answer. Unfortunately, my focus was to get the text without a commit. Thus, Script will not do exactly what I want.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 07:06:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768851#M94915</guid>
      <dc:creator>NaivePlatypus29</dc:creator>
      <dc:date>2024-06-27T07:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a "Get Text Changed" functionality for a TextEditBox in a JMP Application?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768894#M94918</link>
      <description>&lt;P&gt;Thank you, pmroz. Your solution led me to the following code, which works as intended.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;filter_text = Function( {this, entered_txt},
	{msg}, 
	// only attempt to filter if there is any text
	If( entered_txt != "",
		If( Length( entered_txt ) &amp;lt;= 3,
			msg = Char( entered_txt ) || " is below length limit",
			msg = Char( entered_txt ) || " is above length limit"
		);
		Text2 &amp;lt;&amp;lt; set text( msg );
	)
);		// end filter_text function

TextEdit1 &amp;lt;&amp;lt; set text changed( filter_text );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 08:34:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-quot-Get-Text-Changed-quot-functionality-for-a/m-p/768894#M94918</guid>
      <dc:creator>NaivePlatypus29</dc:creator>
      <dc:date>2024-06-27T08:34:50Z</dc:date>
    </item>
  </channel>
</rss>

