Hey everyone, I am trying to use JQuery to help me load a page on my page so that the user does not have to refresh or move to a new page. So far, I have the code so that the next page's contents will display, but the update button that I have on there won't work and the values are not showing on the table correctly since the values from the first page were not passed. Does anyone have an idea about how to do this? here are some snippets of the code so that you can have an idea of what I did.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
function loaddata()
{
$(document).ready(function(){
$('#display_info').load('sqlPage2.php?engineers');
//var engineers = $(this).;
alert(engineers);
});
}
The call to the function:
echo "<select name='engineers' id='engineers' onchange='loaddata();'>";
Where the information will be displayed at the end:
<div id="display_info"><b>Engineer info will be listed here...</b></div>
So the page loads with the table that I have, but the values in there are undefined and I don't know how to use the value from the first page to pass it on to the next while still on that same page.
It works when I submit the information and go on to the next page. But now I want everything to be done on one page so that it feels like it's more real-time.
Any tips or help would be awesome. Thanks guys!