Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Fetching data from Mysql to text field for edit data but can,t received it...

$
0
0

XML Code is given below:

<Alloy> <Window class="container"> <View id="banner" layout="verticle">

    &lt;ImageView id=&quot;bannerimage&quot; /&gt; 
    &lt;Label id=&quot;logotext&quot; textAlign=&quot;Center&quot;&gt;Ekant Solution &lt;/Label&gt;
&lt;/View&gt;

//This is for user name ...

    &lt;Label id=&quot;label1&quot;  top=&quot;70&quot; text=&quot;User Name&quot; /&gt;
    &lt;TextField id=&quot;txtuid&quot;  top=&quot;100&quot;  width=&quot;250&quot; height=&quot;30&quot; borderColor=&quot;#0D00F2&quot; /&gt;



    // This is for password field... 

  &lt;!-- &lt;Label id=&quot;label2&quot;  top=&quot;150&quot;&gt;Password&lt;/Label&gt;
    &lt;TextField id=&quot;txtpwd&quot; top=&quot;180&quot;  width=&quot;250&quot; height=&quot;30&quot; passwordMask=&quot;true&quot; /&gt;
  --&gt; 

     // Submit Button creation...

     &lt;Button id=&quot;button&quot; onClick=&quot;doClick&quot; title=&quot;Submit&quot;  top=&quot;250&quot; width=&quot;100&quot; height=&quot;50&quot; backgroundColor=&quot;#D1B899&quot; size=&quot;33&quot; left=&quot;50&quot; /&gt;

// Reset button create here..

     &lt;Button id=&quot;button1&quot; onClick=&quot;eraseme&quot; title=&quot;Reset&quot;  top=&quot;250&quot; width=&quot;100&quot; height=&quot;50&quot; backgroundColor=&quot;#B8CAA7&quot; size=&quot;33&quot; right=&quot;60&quot; /&gt;


     // Edit button creation...

 &lt;Button id=&quot;button2&quot; onClick=&quot;edit&quot;
     title=&quot;Edit&quot; top=&quot;350&quot; width=&quot;150&quot; height=&quot;50&quot; backgroundcolor=&quot;#E0D6CC&quot; size=&quot;33&quot; bottom=&quot;5&quot; color=&quot;#546154&quot; 

       borderColor=&quot;#6342FF&quot;&gt;&lt;/Button&gt; 

&lt;/Window&gt;

</Alloy>

index.js code is given below...

function eraseme(){ var texuid; $.txtuid.value=""; alert("Reset Successfull...");

};

$.index.open();

function doClick(e){

    if ($.txtuid.value==&quot;&quot; )
    {
Titanium.API.info(&quot;You need to put a user id in&quot;);
$.txtuid.value=&quot;&quot;;
alert(&quot;Please fill the text&quot;);

    }

};

function doClick(e){

          if($.txtuid.value != &quot;&quot; &amp;&amp; $.txtuid.value != null){ 

                var  request = Ti.Network.createHTTPClient({ 

              onload:alert(&quot;Your chore has been submitted&quot;), 

              onerror: function(e){ 

                  Ti.API.debug(e.error); 

                  alert('There was an error during the conexion'); 

              }, 

              timeout:1000, 

                 });    

//Request the data from the web service, Here you have to change it for your local ip

                 request.open(&quot;POST&quot;,&quot;http://192.168.16.2/justbiz/user.php&quot;); 

                   var params = ({&quot;singh&quot;: $.txtuid.value,});  

              request.send(params); 

          } 

          else{ 

                 alert(&quot;Please write something in the textbox&quot;); 

          }               

          $.txtuid.value = &quot;&quot;;        

   };   

////////////clear   

  function edit()
  {


  if($.txtuid.value != &quot;&quot; &amp;&amp; $.txtuid.value != null){ 

                var  request = Ti.Network.createHTTPClient({ 

              onload:alert(&quot;Your chore has been submitted&quot;), 

              onerror: function(e){ 

                  Ti.API.debug(e.error); 

                  alert('There was an error during the conexion'); 

              }, 

              timeout:1000, 

                 });    

//Request the data from the web service, Here you have to change it for your local ip

                 request.open(&quot;GET&quot;,&quot;http://192.168.16.2/justbiz/fetchdata.php&quot;); 

                   var params = ({&quot;singh&quot;: $.txtuid.value,});  

              request.responseText(params); 

          } 

          else{ 

                 alert(&quot;Please write something in the textbox&quot;); 

          }               

          $.txtuid.value = &quot;&quot;;      

   };   

index.tss code is given below...

"#index": { backgroundColor: "#fff", }, "#banner":{ backgroundColor: "#072550", height:50, top:0 }, "#bannerimage": { image:'/state2.png', left:10 }, "#logotext":{ borderWidth:0, left: 55, color:'fff' }, "Label": { width: Ti.UI.SIZE, height: Ti.UI.SIZE, color: "#000", font: { fontSize: 20, fontFamily: 'Helvetica Neue' }, textAlign: 'center' } , "TextField":{ borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED, color: '#336699' }, ".container":{

}


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>