Submitting text field data to be retrieved later

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
asherrill55
Posts: 3
Joined: Thu Nov 12, 2015 9:13 pm

Submitting text field data to be retrieved later

Post by asherrill55 » Thu Nov 12, 2015 9:18 pm

Hey guys, I'm new around here, so here goes...

Im attempting to create an app where when you type your text into the "text field" and press "submit" via a button, it sends that text to the background and reveals itself after a timed period.

how would one go about doing this?

thanks

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10100
Joined: Fri Feb 19, 2010 10:17 am

Re: Submitting text field data to be retrieved later

Post by richmond62 » Thu Nov 12, 2015 9:47 pm

Personally I would forget about that word "Background" and put your text into another field, off screen, like this:
blah.png
Attachments
vanisher.zip
Here's the stack to play with.
(737 Bytes) Downloaded 151 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Submitting text field data to be retrieved later

Post by dunbarx » Thu Nov 12, 2015 10:27 pm

Something like this in the submit button, assuming there is a hidden field named "hiddenField":(pseudo)

Code: Select all

put fld "visibleField" into fld "hiddenField"
wait 10 seconds
show field "visibleField"
wait until whatever method you choose to hide fld "hiddenField" again
Sounds like fun, no?

Craig Newman

asherrill55
Posts: 3
Joined: Thu Nov 12, 2015 9:13 pm

Re: Submitting text field data to be retrieved later

Post by asherrill55 » Fri Nov 13, 2015 2:35 am

richmond62 wrote:Personally I would forget about that word "Background" and put your text into another field, off screen, like this:
blah.png
Where does this "pseudo" field go? I am getting an error when I try to put the text into a field that is on another card

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Submitting text field data to be retrieved later

Post by dunbarx » Fri Nov 13, 2015 5:20 am

Hi.

I am the "pseudo" guy, not Richmond.

You put text into another field as:

Code: Select all

put whatever into fld "yourField" of card "yourCard".
But if the field is on another card, how will you see it when it pops up after ten seconds? Do you want to go to that card first? I need more definite information about what you are up to. Keep it simple, and carefully explain your intentions.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10100
Joined: Fri Feb 19, 2010 10:17 am

Re: Submitting text field data to be retrieved later

Post by richmond62 » Fri Nov 13, 2015 11:21 am

"I am the "pseudo" guy, not Richmond."

You said it Craig.

Oops, sorry, couldn't resist that one.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10100
Joined: Fri Feb 19, 2010 10:17 am

Re: Submitting text field data to be retrieved later

Post by richmond62 » Fri Nov 13, 2015 11:24 am

Yes, Craig uses 'pseudo'; my method is much more 'primitive' insofar
as it uses 2 fields: one which is visible because it is one the card, and
another which is not visible because its top is set to a higher number
than the height of the card.

If you look for field "ff2" in the Preferences Palette you can set
its top to 100 and it will 'magically' appear so that it is easier to
understand what is going on.

While my method is more 'primitive' than Craig's method that makes
it somewhat easier to understand.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Submitting text field data to be retrieved later

Post by dunbarx » Fri Nov 13, 2015 3:35 pm

asherrill55..

"pseudo" is commonly used in code samples to indicate that formal syntax is not followed. So though the first three lines in my example code snippet are valid, the last one is not. That line is instructional only, and intended just to tell you something.

One might say that "pseudo" pseudo could be something like this, commonly posted:

Code: Select all

on mouseUp
doSomething
end mouseUp
See?

In any case, I still do not fully understand what you intend. What does my suggestion that you show and hide (after a time) a field on the same card you are on lack?

Craig

asherrill55
Posts: 3
Joined: Thu Nov 12, 2015 9:13 pm

Re: Submitting text field data to be retrieved later

Post by asherrill55 » Tue Nov 17, 2015 5:25 pm

dunbarx wrote: "But if the field is on another card, how will you see it when it pops up after ten seconds? Do you want to go to that card first? I need more definite information about what you are up to. Keep it simple, and carefully explain your intentions.

Craig
Hi Craig,

Thanks for attempting to help me! My intentions are to have a card where text is typed into a field and on "submit" the text goes to a hidden area inside the app, only to be revealed on another card after 24 hours. The app is centered around allowing for a user to submit an idea they may need to "sleep on" before they act on it.

Thanks again

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Submitting text field data to be retrieved later

Post by dunbarx » Tue Nov 17, 2015 6:51 pm

OK.

So you would (pseudo :D )

Code: Select all

"submit" button loads data to hidden field on another card
send a message in 24 hours to navigate to that card, and show the field
Simple to do. As long as the app is running, the delayed process will pop up. Can you write this? Use 10 seconds instead of a day, so you can test. By the way, the actual code will hardly be bigger than the above.

Craig

Post Reply