<?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: Help with updating a text edit box based upon a radio box selection in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-with-updating-a-text-edit-box-based-upon-a-radio-box/m-p/610798#M81146</link>
    <description>&lt;P&gt;So solved my own problem!&amp;nbsp; Good old scripting index for the win.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to move the if statement into the radio box and then use the "set" commands to send updated info to the text edit boxes.&amp;nbsp; Hope this helps someone in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;							rb = Radio Box( {"wkly", "mntly", "qtrly", "Custom"},
							
											rbstate=rb&amp;lt;&amp;lt;Get Selected;
											if(rbstate=="wkly",
													teb&amp;lt;&amp;lt;set text( "WKLY Report "||char(Abbrev Date(today())) );
													nebs&amp;lt;&amp;lt;set(Today() - In Weeks( 1 ));
												);
											if(rbstate=="mntly",
													teb&amp;lt;&amp;lt;set text( "MNTLY Report "||char(Abbrev Date(today())) );
													nebs&amp;lt;&amp;lt;set(Today() - In Weeks( 4 ));
												);
											if(rbstate=="qtrly",
													teb&amp;lt;&amp;lt;set text( "QTRTLY Report "||char(Abbrev Date(today())) );
													nebs&amp;lt;&amp;lt;set(Today() - In Weeks( 13 ));
												);
											if(rbstate=="Custom",
													teb&amp;lt;&amp;lt;set text( "Cust. Report "||char(Abbrev Date(today())) );
													nebs&amp;lt;&amp;lt;set(.);
												);
													
											
											
								
							);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 11 Mar 2023 17:05:50 GMT</pubDate>
    <dc:creator>shampton82</dc:creator>
    <dc:date>2023-03-11T17:05:50Z</dc:date>
    <item>
      <title>Help with updating a text edit box based upon a radio box selection</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-updating-a-text-edit-box-based-upon-a-radio-box/m-p/610643#M81134</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I was hoping someone could help me with this script.&amp;nbsp; I would like the start date and the report name to update based upon what radio button is selected:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shampton82_0-1678473280625.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/50921i35312866FA5FC3CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_0-1678473280625.png" alt="shampton82_0-1678473280625.png" /&gt;&lt;/span&gt;&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;//rev 3-9-23
names default to here(1);

dtspec="J:\Public\Ti Process Control\Dashboard Files\JMP data for CC's\Limits\Master limits table rev 10-10-22.jmp";



//Get user name
dll = Load DLL( "mpr.dll" );

dll &amp;lt;&amp;lt; DeclareFunction(

     "WNetGetUserA",

      Convention( STDCALL ),

      Alias ( "GetUserName" ),

      Arg( UInt8, "format", input ),

      Arg( AnsiString, "username", output ),

      Arg( UInt64, "length", update ),

      Returns( UInt32 )

);

username = "                            ";

unlen = length(username);

result = dll &amp;lt;&amp;lt; GetUserName(0, username, unlen);

rbstate="wkly";


/* Create a modal user dialog */
nw1=New Window( "Select Date Range for out of spec",&amp;lt;&amp;lt;Modal,
				/* Arrange display boxes in two columns */
				hlistbox(
						panelbox("data length",
						Lineup Box( N Col( 2 ),
							rb = Radio Box( {"wkly", "mntly", "qtrly", "Custom"},rbstate=rb&amp;lt;&amp;lt;Get Selected;);
							
						)),
							panelbox("set up",
							Lineup Box( N Col( 2 ), Spacing( 10 ),
										/* Prompt for a report title */
										Text Box( "Report Title:" ),
										

										if(rbstate=="wkly",
											teb = Text Edit Box( "WKLY Report "||char(Abbrev Date(today())) );,
												weeksback=1;
											rbstate=="mntly",
											teb = Text Edit Box( "MNTLY Report "||char(Abbrev Date(today())) );,
												weeksback=4;
											rbstate=="qtrly",
											teb = Text Edit Box( "QTRTLY Report "||char(Abbrev Date(today())) );,
												weeksback=13;
											rbstate=="Custom",
											teb = Text Edit Box( "Cust. Report "||char(Abbrev Date(today())) );,
												weeksback=26;
										),
										/* Prompt for start and end dates */
										Text Box( "Start Date:" ),
										Text Box( "End Date:" ),
										/* Number Edit Box with a calendar pop-up */
										nebs = Number Edit Box(
													Today() - In Weeks( weeksback ),
													12,
													&amp;lt;&amp;lt;Set Format( Format( "m/d/y", 12 ) )
										),
										/* Number Edit Box with a calendar pop-up */
										nebe = Number Edit Box(
													(Today()-86400),
													23,
													&amp;lt;&amp;lt;Set Format( Format( "m/d/y", 12 ) )
										),
										cb=Check Box( "Make Project?" ),cb &amp;lt;&amp;lt; Set( 1, 1 );,
										/* OK button captures the values */

							))
				,
					vlist box(
						panelbox("spec table",
						text = Text Edit Box( dtspec ),text &amp;lt;&amp;lt; Set Wrap( 150 ),text &amp;lt;&amp;lt; Get Wrap;
						)
				,
						Button Box( "OK",
									rtitle = teb &amp;lt;&amp;lt; Get Text;
									sdate = nebs &amp;lt;&amp;lt; Get;
									edate = nebe &amp;lt;&amp;lt; Get;
									cbstate=cb&amp;lt;&amp;lt;get;
									fileloc=text&amp;lt;&amp;lt;Get Text();
						)
						)
				)
);


If( nw1["button"] == -1,
Throw( "Cancelled!" );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I was thinking I need to use append somehow but not quite sure how to get there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:29:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-updating-a-text-edit-box-based-upon-a-radio-box/m-p/610643#M81134</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2023-06-08T16:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with updating a text edit box based upon a radio box selection</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-updating-a-text-edit-box-based-upon-a-radio-box/m-p/610798#M81146</link>
      <description>&lt;P&gt;So solved my own problem!&amp;nbsp; Good old scripting index for the win.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to move the if statement into the radio box and then use the "set" commands to send updated info to the text edit boxes.&amp;nbsp; Hope this helps someone in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;							rb = Radio Box( {"wkly", "mntly", "qtrly", "Custom"},
							
											rbstate=rb&amp;lt;&amp;lt;Get Selected;
											if(rbstate=="wkly",
													teb&amp;lt;&amp;lt;set text( "WKLY Report "||char(Abbrev Date(today())) );
													nebs&amp;lt;&amp;lt;set(Today() - In Weeks( 1 ));
												);
											if(rbstate=="mntly",
													teb&amp;lt;&amp;lt;set text( "MNTLY Report "||char(Abbrev Date(today())) );
													nebs&amp;lt;&amp;lt;set(Today() - In Weeks( 4 ));
												);
											if(rbstate=="qtrly",
													teb&amp;lt;&amp;lt;set text( "QTRTLY Report "||char(Abbrev Date(today())) );
													nebs&amp;lt;&amp;lt;set(Today() - In Weeks( 13 ));
												);
											if(rbstate=="Custom",
													teb&amp;lt;&amp;lt;set text( "Cust. Report "||char(Abbrev Date(today())) );
													nebs&amp;lt;&amp;lt;set(.);
												);
													
											
											
								
							);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Mar 2023 17:05:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-updating-a-text-edit-box-based-upon-a-radio-box/m-p/610798#M81146</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2023-03-11T17:05:50Z</dc:date>
    </item>
  </channel>
</rss>

