X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/24560f82492efc949a52306199478e43d7b70e31..8701688ce44b9ba12b61ec1d3c4d9c5ed2c19f0e:/js/forms.js diff --git a/js/forms.js b/js/forms.js index ff0f33d..8db2d66 100644 --- a/js/forms.js +++ b/js/forms.js @@ -1,12 +1,22 @@ /* vim: set ts=4 tw=4 sw=4 noet: */ function updateRowsPerPage() { + var rowsPerPage = document.getElementById("rows"); + var found = false; var link = document.getElementsByTagName('a'); for (var i = 0; i < link.length; i++) { var url = link[i].href; - if ((var pos = url.search('rowsperpage')) >= 0) { + var pos = url.search('rowsperpage'); + if (pos >= 0) { + found = true; var base = url.slice(0, pos); alert('base: ' + base); } } + if (found == false) { + /* current page has rows < current rows per page */ + var href = location.href; + href = href + '?rowsperpage=' + rowsPerPage.value; + location.href = href; + } }