<form>
Select Project:*
<select name="project_id" id="project_id" >
<option value="0">Select Project</option>
<option value="1">a</option>
<option value="2">b</option>
<option value="3">c</option>
</select>

Select Week*:
<select name="week" id="week_id">
<option value="0">Select Week</option>
<option value="1">This Week</option>
<option value="2">Last Week</option>
<option value="3">2 Weeks back</option>
</select>

</form>



<script type="text/javascript" src="js/jquery-latest.js"></script>                    


<script>
  function showValues() {
    var str = $( "form" ).serialize();
    //$( "#mydiv" ).text( str );

  $.ajax({
      type :  'POST',
      url  :  'test.php',
      data :  str,
      dataType : "html",
      success: function(htmlResponse)
      {

      }
  });
  }

  $( "select" ).on( "change", showValues );
  showValues();
</script>




test.php

<?php
echo $_POST['project_id'];
echo $_POST['week'];
?>

works the result is in the htmlResponse var

<form>
Select Project:*
<select name="project_id" id="project_id" >
<option value="0">Select Project</option>
<option value="1">a</option>
<option value="2">b</option>
<option value="3">c</option>
</select>
Select Week*:
<select name="week" id="week_id">
<option value="0">Select Week</option>
<option value="1">This Week</option>
<option value="2">Last Week</option>
<option value="3">2 Weeks back</option>
</select>
</form>
<div>return:<span id="returnValue"></span></div>
<script type="text/javascript" src="js/jquery-latest.js"></script>
<script>
function showValues() {
    var str = $( "form" ).serialize();
    //$( "#mydiv" ).text( str );
    $.ajax({
    type : 'POST',  
    url : 'test.php',
    data : str,
    dataType : "html",
    success: function(htmlResponse)
        {
        $("#returnValue").html(htmlResponse);
        }
    });
}

$( "select" ).on( "change", showValues );
showValues();
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.