textfield POST

You must Login before you can answer or comment on any questions.

Hello

When I create a textField and I want to send to a server via POST, how I can retrieve its value, can be for your variable?

3 Answers

Accepted Answer

var textField = Ti.UI.createTextField({
  borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
  color: '#336699',
  top: 10, left: 10,
  width: 250, height: 60
});
the value is retrieved textField.value

ok

Where to put those variables that can be sent via POST with HTTPClient .... This is my code

var url = "http://apps.zoup.cl/chevrolet/orlando/deliver.php";
         var client = Ti.Network.createHTTPClient({
     // function called when the response data is available
         onload : function(e) {
         Ti.API.info("Received text: " + this.responseText);
         alert(username);
         },
     // function called when an error occurs, including a timeout
         onerror : function(e) {
         Ti.API.debug(e.error);
         //******************************************************
 
         //******************************************************
         alert('error');
         },
         timeout : 5000  // in milliseconds
         });
 // Prepare the connection.
         client.open("POST", url);
 // Send the request.
         client.send(); 
         });
Not sure if I have to turn HTTPCliente variables or if the sent automatically.

Your Answer

Think you can help? Login to answer this question!