Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 41

Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
09/06/14 05:50 AM (9 years ago)

Ultimate Screen Creator Variable from Text Field

Hi I've posted a lot this week about the USC plugin, but I need to do a lot with it! Basically, I have a php script. And what I need to do is allow a user to type in a word in a text field, set the word as a variable or something like that, then submit the word in the script. It will be pulling information from MSSQL and displaying it in an Alert View. How can I set the variable and use it in a php script? So basically... 1) User types in string into text field 2) When button is pressed, word in text field is used as a variable in a PHP script (how to execute?) 3) When script is executed and JSON is returned, show an Alert View (using the Alert View plugin) with the JSON that is returned. Possible? Thanks Ed
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/07/14 02:33 PM (9 years ago)
Give the field a name. Assign the button an action of submitting data to a URL. Use the field name to handle receiving the data as a post request. So if you name it "username", you'd get the value in php with: $username = $_Post['username'];
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/16/15 09:41 PM (9 years ago)
C code variation on the question... 1) How would you assign the value of the USC Text element named 'username' to a nsstring variable? 2) Same question for a USC image element to UIImage? I purchased the plugin last year, and has been awhile since I have used it. Layout of screens is super easy, but how to use the data. Is there a small how-to document or a thread I missed that already talks about using the values of screen elements in your code? (Text, Label, Image, etc.) For example the demo on YouTube shows using the Slider Element to change the value of a Label Element- how do you then use that value in your code? Thanks!!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.