Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing jQuery to load a PHP Page in a div
    primarykey
    data
    text
    <p>I have this script:</p> <pre><code>&lt;script type='text/javascript' src='js/jquery-1.4.4.mi.js'&gt;&lt;/script&gt; &lt;script type='text/javascript'&gt; $('.filterMonth').change(function(){ alert('ijijiji'); $.ajax({ url: 'ajax/filterMandays.php', //type: 'GET', success: function(data){ //data is returned back $('#mandayTable').html(data); } }); }); &lt;/script&gt; </code></pre> <p>and this html:</p> <pre><code>&lt;select name ="filterMonth"&gt; &lt;?php $array_month = array("January","February","March","April","May","June","July","August","September","October","November","December"); foreach($array_month as $key =&gt; $month) { $value_month = $key+1; echo "&lt;option value = '$value_month'&gt;$month&lt;/option&gt;"; } ?&gt; &lt;/select&gt; - &lt;select name = "filterYear" onChange = "filter(filterMonth.value, filterYear.value)"&gt; &lt;?php $curYear = date('Y'); for($i = 1990; $i&lt;=$curYear+10; $i++) { if($i == $curYear) { echo "&lt;option value = '$i' selected = 'selected'&gt;$i&lt;/option&gt;"; } else { echo "&lt;option value = '$i'&gt;$i&lt;/option&gt;"; } } ?&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/br&gt; &lt;/br&gt; &lt;tr&gt; &lt;div id="mandayTable"&gt;&lt;/div&gt; </code></pre> <p>and this php page:</p> <pre><code>&lt;?php include("all.php"); $q = "SELECT md.mandays_id,md.employeenum,md.month,md.year,md.required_man_days,d.firstname,d.lastname FROM tbl_mandays md,tbl_employee_details d WHERE md.active = '1' AND md.employeenum = d.employeenum AND md.month = '10';"; $res = $db-&gt;Execute($q); echo "&lt;table border = 1&gt;"; echo "&lt;tr&gt;&lt;th&gt;Employee Number&lt;/th&gt;&lt;th&gt;First Name&lt;/th&gt;&lt;th&gt;Last Name&lt;/th&gt;&lt;th&gt;Month-Year&lt;/th&gt;&lt;th&gt;Required Man Days&lt;/th&gt;&lt;th&gt;Edit/Delete&lt;/th&gt;&lt;/tr&gt;"; while($rows = $res-&gt;FetchRow()) //for($i=0;$i&lt;5;$i++) { //iterating through // check if employee // // if(isset($row[])) { } $mandays_id = $rows[0]; $empnum = $rows[1]; $month_year = $rows[2] ."-" .$rows[3]; $required_man_days = $rows[4]; $firstname = $rows['month']; $lastname = $rows[6]; //echo approvers here are not taken //&lt;a href=\"view_team.php?id=".$empnum."\" -&gt; for someone to view the people beneath them (like org tree) echo "&lt;tr&gt;&lt;td&gt;".$empnum . "&lt;/td&gt;&lt;td&gt;".$firstname ."&lt;/td&gt;&lt;td&gt;".$lastname ."&lt;/td&gt;&lt;td&gt;" . $month_year ."&lt;/td&gt;&lt;td&gt;" .$required_man_days . "&lt;/td&gt;&lt;td width = \"200\" align = \"center\"&gt;&lt;a href = 'edit_mandays.php?mandays_id=$mandays_id');'&gt;Edit/Delete&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;"; } echo "&lt;/table&gt;"; ?&gt; </code></pre> <p>the script should basically load the php page in the div in the html once the "filterMonth" has been changed. but it doesn't work.</p> <p>what seems to be the problem? :(</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload