<?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: Any way to trigger OK button in modal window through script (i.e. when pressing Enter key in Text Edit Box)? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Any-way-to-trigger-OK-button-in-modal-window-through-script-i-e/m-p/534865#M75736</link>
    <description>&lt;P&gt;You could use something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt;Set Function(Function({this}, (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; Click()))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but do note that this will also trigger if user clicks outside the text edit box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

win = New Window("Text window",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;Return Result,
	Text Box("Type in your input"),
	textbox = Text Edit Box("", &amp;lt;&amp;lt; Set Function(function({this},
		(this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; Click()
	))),
	Button Box("OK"),
	Button Box("Cancel")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 21:37:33 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-08-17T21:37:33Z</dc:date>
    <item>
      <title>Any way to trigger OK button in modal window through script (i.e. when pressing Enter key in Text Edit Box)?</title>
      <link>https://community.jmp.com/t5/Discussions/Any-way-to-trigger-OK-button-in-modal-window-through-script-i-e/m-p/534857#M75734</link>
      <description>&lt;P&gt;I have a modal window that asks user for text input using Text Edit Box.&lt;/P&gt;&lt;P&gt;For better user experience I'd like to make it so that when user hits Enter after typing in the input, it would be the same as user clicking OK button. Is there a way to do this?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;win = New Window( "Text window",
&amp;lt;&amp;lt;Modal,
&amp;lt;&amp;lt;Return Result,
Text Box( "Type in your input" ),
textbox = Text Edit Box(  &amp;lt;&amp;lt;Set script(/*Some script here to hit OK button when Enter is pressed */) ),
Button Box( "OK" ),
Button Box( "Cancel" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:07:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Any-way-to-trigger-OK-button-in-modal-window-through-script-i-e/m-p/534857#M75734</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2023-06-09T17:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to trigger OK button in modal window through script (i.e. when pressing Enter key in Text Edit Box)?</title>
      <link>https://community.jmp.com/t5/Discussions/Any-way-to-trigger-OK-button-in-modal-window-through-script-i-e/m-p/534864#M75735</link>
      <description>&lt;P&gt;I got this one!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;win = New Window( "Text window",
&amp;lt;&amp;lt;Modal,
&amp;lt;&amp;lt;Return Result,
Text Box( "Type in your input" ),
textbox = Text Edit Box(  &amp;lt;&amp;lt;Set script(okbutton &amp;lt;&amp;lt; Click()) ),
okbutton = Button Box( "OK" ),
Button Box( "Cancel" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 21:33:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Any-way-to-trigger-OK-button-in-modal-window-through-script-i-e/m-p/534864#M75735</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-08-17T21:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to trigger OK button in modal window through script (i.e. when pressing Enter key in Text Edit Box)?</title>
      <link>https://community.jmp.com/t5/Discussions/Any-way-to-trigger-OK-button-in-modal-window-through-script-i-e/m-p/534865#M75736</link>
      <description>&lt;P&gt;You could use something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt;Set Function(Function({this}, (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; Click()))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but do note that this will also trigger if user clicks outside the text edit box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

win = New Window("Text window",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;Return Result,
	Text Box("Type in your input"),
	textbox = Text Edit Box("", &amp;lt;&amp;lt; Set Function(function({this},
		(this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; Click()
	))),
	Button Box("OK"),
	Button Box("Cancel")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 21:37:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Any-way-to-trigger-OK-button-in-modal-window-through-script-i-e/m-p/534865#M75736</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-08-17T21:37:33Z</dc:date>
    </item>
  </channel>
</rss>

