Moving cursor to the beginning of a text field after save

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
matt
Posts: 18
Joined: Sat Jun 12, 2010 2:40 am

Moving cursor to the beginning of a text field after save

Post by matt » Fri Nov 19, 2010 8:30 pm

Hi, I'm relatively new with RunRev / LiveCode and I was hoping someone had advice for how to move a cursor to the beginning of a text field. Right now I've got several fields set up so that when a user clicks Enter the data will be saved. That all works fine, and then the field is emptied, but I can't seem to put the cursor back at the beginning of the text field for the next record. Can anyone advise on how to accomplish this? I've looked around in the forums and the documentation but still haven't managed to get this working. Thanks for your help!

Script within the field

Code: Select all

on rawKeyDown theKey
   --Saves field contents when user hits return
   if theKey is 65293 then
      send mouseup to button "btnWho"
   end if
   pass rawKeyDown
end RawKeyDown
button script includes:

Code: Select all

revExecuteSQL gConID,tSQL
put "" into the field "Who" --Doesn't seem to move the cursor back to the top of the multiline field

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Moving cursor to the beginning of a text field after save

Post by Klaus » Fri Nov 19, 2010 10:38 pm

Hi Matt,

...
select before text of fld "Who"
...
will do the trick :)


Best

Klaus

matt
Posts: 18
Joined: Sat Jun 12, 2010 2:40 am

Re: Moving cursor to the beginning of a text field after save

Post by matt » Sat Nov 20, 2010 3:19 pm

Hi Klaus,

Thank you for your help!

-Matt

Post Reply