I am trying to create a dynamic 'page' listing for threads/comments using AJAX.
in PHP, I look over results and limit the database query to '$page, $page+10'
Now, all I need to do is figure out how to send what page the user wants to view to the PHP.
here is the code that generates the different page buttons:
var htmlpage = "<div class='pages'><ul>"
for (i=1 ; i < pages+1 ; i++)
{
htmlpage += "<li><input type='submit' id='page"+i+"' value='"+i+"' onclick='updatefilters(document.getElementById('page1').value);' /></li>"
}
htmlpage += "<div>"
htmlpage += "</ul>";
*this is being done through javascript with data returned through JSON/AJAX call.
document.getElementById('page1').value is giving me a
syntax error[Break On This Error] updatefilters(document.getElementById(
error. I've tried different formatting, and just ended on this. I just don't know javascript well enough to figure out the problem.
I need to send the value of the submit button to the updatefilters() function. Any suggestions on how to do it?
Thanks