I have a Post Form in wich i use to Search results.
<form method="post" enctype="multipart/form-data" name="byMonthYear">
<label><h2>Search Colection by Month and Year:</h2></label>
<select name="month">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="year">
<?php
$get_year = date('Y') + 1;
for($i = $get_year;$i >= 2013;$i--){
echo "<option value=".$i.">".$i."</option>";
}
?>
</select>
<input type="button" value="Search" onclick="return search_buss_byMonthYear()">
</form>
On click i call AJAX to get the results search_buss_byMonthYear();
function search_buss_byMonthYear(){
$('#loading').show();
var month = document.forms['byMonthYear']['month'].value;
var year = document.forms['byMonthYear']['year'].value;
var dataString = 'month='+ month + '&year=' + year;
if(month == '')
{
document.getElementById("results").innerHTML = "<div class='alert_error'>You must fill all fields! <br></div>";
}else{
$.ajax({
type: "post",
url: "inc/byMonthYear.php",
data: dataString,
contentType: "application/x-www-form-urlencoded",
success: function(responseData, textStatus, jqXHR) {
$('#loading').hide();
document.getElementById("results").innerHTML = responseData;
},
error: function(jqXHR, textStatus, errorThrown) {
$('#loading').hide();
document.getElementById("results").innerHTML = "<div class='alert_error'>Your action had errors! <br></div>";
}
});
}
}
on the File byMonthYear.php i have the php script to get the results, and is working very good, BUT i want to add some additional javascript action on that page byMonthYear.php.. But its not responding the jQuery there! I put just alert("hello"); to test is but its not responding !! Any idea how to bind the jQuery to work in this conditions !
Thanks