Page 1 of 1

Live code text feild and datagrid problem

Posted: Wed Nov 04, 2015 6:09 am
by daybreak
Basically I want the user to type a name of item in text field box. when they click the confirm button it should show up in the data grid. Now the problem i'm having is how to get the text to move to line 2 when the user enters another name and click the confirm once and not overwriting the previous on the same line?

Re: Live code text feild and datagrid problem

Posted: Wed Nov 04, 2015 3:00 pm
by dunbarx
Hi.

Try this experiment. Make a button and two fields on a card. In the button script:

Code: Select all

on mouseUp
   put the last line of fld 1 into fld 2
   put return after fld 1
   select after fld 1
end mouseUp
Now if you type into fld 1, and then click the button, the text just typed will appear in fld 2. The selection will move to the next line in fld 1, ready for new data.

This is a cute little lesson in using LC to fool around with text. But it seems to me to be fragile, in that the user can upset the formatting of fld 1 by hand. So first off, does this actually do what you asked? If so, is it robust enough? Do you think you want a bit more control over what the user does, so that he cannot, say, delete data or modify the format in fld 1? All these are possible. It also may be useful to re-think your input method. Write back with thoughts and complaints.

Craig Newman

Re: Live code text feild and datagrid problem

Posted: Wed Nov 04, 2015 3:03 pm
by Klaus
Hi daybreak,

1. hello and welcome to the forum! :D
2. What Craig said!


Best

Klaus

Re: Live code text feild and datagrid problem

Posted: Wed Nov 04, 2015 6:25 pm
by MaxV

Re: Live code text feild and datagrid problem

Posted: Wed Nov 04, 2015 11:41 pm
by daybreak
Hi guy and thank you all for the reply. Just got home I will test and see what works :)