Welcome Guest, Not a member yet? Register   Sign In
I can't get the value
#1

(This post was last modified: 01-15-2015, 08:27 PM by bobykurniawan.)

Good day sir, i've a question about get the value. First please kindly check my view

Code:
    <script type="text/javascript">
     function shipper(){
       var shippername  = $("#shippername").val();
          if(shippername.length > 2){
                     $.post("<?=base_url(); ?>home/cekada/shipper", {
                         shippername: $('#shippername').val(),
                         },
      function(response){
                   setTimeout("finishAjax('Info', '"+escape(response)+"')", 450);
                     });
                   }else{
                        $('#Info').fadeOut(10);
                      }
              }
   function finishAjax(id, response){
     $('#'+id).html(unescape(response));
     $('#'+id).fadeIn(100);
   }
   </script>
<div class="col-sm-1 col-md-6">
       <div class="panel panel-default">
                       <div class="panel-heading">
                               <h3 class="panel-title">Data Shipper</h3>
                       </div>
                        <div class="panel-body">
                           <div class="form-group">
 <form role="form" method="post" action = "<?=base_url();?>home/siprocess">
                             <label> Name : </label>
                           <input type='text' onkeyup="shipper()" name='shippername' id='shippername' class="autocomplete form-control" />
                        </div>
                                   <span id='Info'>                              
                                   </span>  
                        </div>

       </div>
 </div>



Then here is my controller 


Code:
$shippername = strtolower($this->input->post('shippername'));
   $sql = "SELECT * FROM shipper where shippersname = '$shippername'";
   $hasil = $this->shippermodel->cariquery($sql);
   foreach($hasil as $result)
   {
       $address = $result->address;
       $phone = $result->phone;
       $fax = $result->fax;
   }
       if($hasil != NULL)
       {
           echo "
                   <div class='form-group'>
                      <label> Address : </label>
                       <textarea name='shipperaddress' class='form-control'>$address</textarea>    
                    </div>
                     <div class='form-group'>
                       <label> Phone Number : </label>
                       <input type='text' name='shipperphone' value='$phone' class='form-control'>
                     </div>
                     <div class='form-group'>
                       <label> Fax : </label>
                       <input type='text' name='shipperfax' value='$fax' class='form-control'>
                    </div>
              ";
       }

explanation.

I input the shippername field from the form then it'll show up the field fill up by the other data from database. But when i try to 


PHP Code:
$shippername $this->input->post('shippername');
        
$shipperphone $this->input->post('shipperphone');
        
$shipperfax $this->input->post('shipperfax');
        echo 
$shippername; echo $shipperphone; echo $shipperfax

only shippername have value.


Sorry for bad english
Reply


Messages In This Thread
I can't get the value - by bobykurniawan - 01-15-2015, 08:26 PM
RE: I can't get the value - by mwhitney - 01-16-2015, 12:17 PM
RE: I can't get the value - by bobykurniawan - 01-18-2015, 06:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB