title: Showing up highchart after submitting form in other file
body: <p>Kindly need help...
  I want to show Highchart in file_1, when highchart script is on file_2..
  i'm using PHP, Jquery and AJAX...
  here is the script</p>
  
  <p>SCR_test02.php </p>
  
  <pre><code>&lt;?php 
  
  require "function.inc.php";
  //require "showscr.php";
  
  include "conn.php";
  include "q_table.php";
  
  ?&gt; 
  
  &lt;form name="scr_form"&gt;
  &lt;table border="1" align="center" width="80%"&gt;
  &lt;tr&gt;
    &lt;td align="center"&gt;
     &lt;input type="button" onClick="SCRajaxFunction()" value="Submit" id="sub"&gt;
    &lt;/td&gt;
    &lt;td&gt;
     &lt;input type="reset"&gt;
    &lt;/td&gt; 
   &lt;/tr&gt;  
  &lt;tr&gt;
      &lt;td colspan="6"&gt;&amp;nbsp;
      &lt;div id="scr"&gt;&lt;/div&gt;
      &lt;/td&gt;
  
  &lt;/tr&gt;
  
  
  &lt;/table&gt;
  
  &lt;/form&gt;
  &lt;script src="../Highcharts-3.0.5/js/highcharts.js"&gt;&lt;/script&gt;
  
  
  &lt;/html&gt; 
  </code></pre>
  
  <p>function.inc</p>
  
  <pre><code>var htmlobjek; 
  $(document).ready(function()
  { 
  
    $("#region").change(function()
    {
      var region = $("#region").val(); 
      $.ajax(
      { 
          url: "GetMSC.php", 
          data: "region="+region, 
          cache: false, 
          success: function(msg)
          {   
              $("#msc").val(msg); 
          } 
      }); 
    }); 
  }); 
  
  
  
  //Ketika form di submit
  function SCRajaxFunction(){
      var ajaxRequest;  // The variable that makes Ajax possible!
  
      try{
          // Opera 8.0+, Firefox, Safari
          ajaxRequest = new XMLHttpRequest();
      } catch (e){
          // Internet Explorer Browsers
          try{
              ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (e) {
              try{
                  ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
              } catch (e){
                  // Something went wrong
                  alert("Your browser broke!");
                  return false;
              }
          }
      }
      // Create a function that will receive data sent from the server
      ajaxRequest.onreadystatechange = function()
      {
          if(ajaxRequest.readyState == 4)
          {
              var ajaxDisplay = document.getElementById('scr');
              ajaxDisplay.innerHTML = ajaxRequest.responseText;
          }
      }
      var period = document.getElementById('period').value;
      var datefrom = document.getElementById('datefrom').value;
      var dateto = document.getElementById('dateto').value;
      var region = document.getElementById('region').value;
      var msc = document.getElementById('msc').value;
      //var rows = document.getElementById('rows').value;
      var dataString = "?datefrom=" + datefrom + "&amp;dateto=" + dateto + "&amp;region=" + region + "&amp;msc=" + msc + "&amp;period=" + period;// + "&amp;rows=" + rows;
      ajaxRequest.open("GET", "ShowSCR.php" + dataString, true);
      ajaxRequest.send(null); 
  }
  </code></pre>
  
  <p> </p>
  
  <p>ShowSCR</p>
  
  <pre><code>&lt;html&gt;  
  
  &lt;?
  require "function.inc.php";
      //require "highchart_tes.php";
      include "conn.php";
  
      $period = $_GET['period']; 
      $datefrom = $_GET['datefrom']; 
      $dateto = $_GET['dateto'];
      $region = $_GET['region'];
      $msc = $_GET['msc'];
  
          $drop=array(); 
          $drop2=array();     
          $traffic=array();
          $data1=array(); 
          $data2=array();
          $sql = "SELECT distinct Date_id, hour_id 
              FROM scrkpi_h
              WHERE Date_id &gt;= '2012-12-01' 
              AND Date_id &lt;= '2012-12-03'
              AND MSC like 'MSBDL%'
              ORDER BY Date_id ASC ";  
          $qry = mysql_query($sql,$koneksi) or die ("Gagal Query - ".mysql_error());  
          while ($data=mysql_fetch_array($qry))
          {  
  
  
              $a = date('Y-m-d ', strtotime($data['Date_id']));
              $data1[] = $a. $data[1];
  
          }  
  
  
  ?&gt;  
      &lt;script type="text/javascript" src="../Highcharts-3.0.5/js/type/jquery-1.7.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="../Highcharts-3.0.5/js/highcharts.js"&gt;&lt;/script&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
  
      var chart1;
      $(document).ready(function() 
      {
              chart1 = new Highcharts.Chart(
              {
                  chart: {
                  renderTo: 'scr_core'
                  },
                  title: {
                      text: 'SCR Core ',
                      x: -20 //center
                  },
                  subtitle: {
                      text: '',
                      x: -20
                  },
                  xAxis: 
                  {
                      categories: ['&lt;?php echo join($data1, "','") ?&gt;'],
                      //['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  
                      labels: 
                      {
                          rotation: -90
                      }   
                  },
                  yAxis: {
                      title: {
                          text: '%'
                      },
                      plotLines: [{
                          value: 0,
                          width: 1,
                          color: '#808080'
                      }]
                  },
                  tooltip: {
                      formatter: function() {
                              return '&lt;b&gt;'+ this.series.name +'&lt;/b&gt;&lt;br/&gt;'+
                              this.x +': '+ this.y +' % (percentage)';
                      }
                  },
                  legend: {
                      layout: 'vertical',
                      align: 'right',
                      verticalAlign: 'middle',
                      borderWidth: 0
                  },
                  series: 
                  [
                  &lt;?php //query tiap msc lbih dulu, baru tiap msc diambil datanya, dijadikan data berjajar berdasar koma
                  $sql   = "SELECT distinct msc_id, MSC 
                          FROM `scrkpi_h` 
                          WHERE MSC like 'MSBDL%'"; //buat data di legend
                  $query = mysql_query( $sql );
                  while( $ret = mysql_fetch_array( $query ) ){
                     $nId = $ret[0]; //query dari scrkpi_h, msc_id = array 0
                     $nodes = $ret[1];
                        $sql_   = "SELECT * FROM `scrkpi_h` 
                        WHERE `msc_id`='$nId' 
                        AND Date_id &gt;= '2012-12-01' 
                        AND Date_id &lt;= '2012-12-03'
                        AND MSC like 'MSBDL%'
                        ORDER BY Date_id ASC ";
                        $query_ = mysql_query( $sql_ );
  
                        $data = "";
                        while( $ret_ = mysql_fetch_array( $query_ ) ){
                           $kel = $ret_['scrCombine'];
                           $data = $data . "," . $kel;
                        }
                        $data = substr( $data , 1 , strlen( $data ) );
                  ?&gt;
                  {
                      name: '&lt;?php echo $nodes; ?&gt;',
                      data: [&lt;?php echo $data; ?&gt;]
                        },
                  &lt;?php
  
  
                  }
                  ?&gt;
                  ]
              });
          });
  
  &lt;/script&gt;
  
  &lt;div id='scr_core' style='min-width: 10px; height: 10px; margin: 0'&gt;&lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The chart already show on file ShowSCR.php 
  But i want to show it on  file SCR_test02.php at div="scr" when i click "submit" button
  how to work it out, i have try many times but not working, really need help</p>