cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Neo
Neo
Level VI

Reset Text Edit Box to empty when rest button is pressed

I would like to reset the Text Edit Box to empty using the reset button in the script below. How to do this?

 

Names Default To Here( 1 );
clear log ();
nw = New Window( "Get Data",
	<<Modal,
	<<Return Result,
	pid = Text Edit Box( "", <<Set Width( 160 ) ),
	Button Box ("Get ID & Data",
	ID = pid << get text;
	show (ID)),
	//getData (ID); run getData script. Get data script will go here.
	Button Box("Reset", /* Reset script to reset text edit box to empty*/),
	Button Box("Cancel", dialog("Cancelled by User"));
);
When it's too good to be true, it's neither
12 REPLIES 12
Neo
Neo
Level VI

Re: Reset Text Edit Box to empty when rest button is pressed

@jthi Thanks. A related question. How to disable my Reset button until an entry is made in the text edit box (and enable it only after the first character entry in the text edit box)?

When it's too good to be true, it's neither
jthi
Super User

Re: Reset Text Edit Box to empty when rest button is pressed

You can disable display boxes using << Enable(0) and set it to 1 when it can be modified and then use << Set Text Changed or << Set function with text edit box

Names Default To Here(1);
win = New Window("Example", 
	teb = Text Edit Box("", << Set Text Changed(function({this, value},
		btn << Enable(!IsMissing(value));
	))),
	btn = Button Box("OK", << Enable(0))
);
-Jarmo
hogi
Level XI

Re: Reset Text Edit Box to empty when rest button is pressed


@jthi wrote:

It does take some time to learn, how to use, scripting index in different ways of searching for information (it is worth it if you do JMP scripting).


Thanks for highlighting it.
I set up a quite similar rule some while ago:
https://community.jmp.com/t5/Discussions/JMP-Scripting-Index-feedback-and-discussion/m-p/583011/high... 
but seems that I don't stick to it.

clear selection - nice