- /* current page has rows < current rows per page */
- var href = location.href + '?rowsperpage=' + rowsPerPage.value;
- alert(href);
- form.action = href;
- form.submit();
+ pos = location.href.search('rowsperpage');
+ if (pos >= 0) {
+ base = location.href.slice(0, pos);
+ } else {
+ base = location.href;
+ }
+ if (base.charAt(base.length - 1) == '?') {
+ href = base + 'rowsperpage=' + rowsPerPage.value;
+ } else {
+ href = base + '?rowsperpage=' + rowsPerPage.value;
+ }
+ } else {
+ pos = location.href.search('rowsperpage');
+ base = location.href.slice(0, pos);
+ href = base + 'rowsperpage=' + rowsPerPage.value;