Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm creating some pagination for my website, and want to use an input-element to navigate between pages.
Like the following example:
Would this be possible to do with XSLT?
Here's what I have so far, I can't figure out where to put the URL changing code:
<xsl:variable name="FF_pageUI" select="umbraco.library:RequestForm('pageUI')" /> <form action="#"> <div class="pagerUI"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <!-- previous page --> <xsl:if test="$page > 1"> <td class="pager-prev"><a class="previous" href="{concat('?page=', $page - 1, $qs)}" title="Previous page">‹</a></td> </xsl:if> <td>Page</td> <td><input id="pageUI" type="text" onchange="document.getElementById('BoostMasterForm').submit()"> <xsl:choose> <xsl:when test="$page=1"> <xsl:attribute name="value">1</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="value"> <xsl:value-of select="$currentPageNumber" /> </xsl:attribute> </xsl:otherwise> </xsl:choose> </input></td> <td>of <xsl:value-of select="$numberOfPages"/></td> <!-- next page --> <xsl:if test="$page * $resultsPerPage < count($matchedNodes)"> <td class="pager-next"><a class="next" href="{concat('?page=', $page + 1, $qs)}" title="Next page">›</a></td> </xsl:if> </tr> </table> </div> </form>
I've also posted this a jQuery question on Stackoverflow:
http://stackoverflow.com/questions/13150264/jquery-pagination-go-to-page-on-input-value-change
Any help would be greatly appreciated.
Cheers, JV
I got it working using the following:
<form type="get" onchange="return false"> <div class="pagerUI"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <!-- previous page --> <xsl:if test="$page > 1"> <td class="pager-prev"><a class="previous" href="{concat('?page=', $page - 1, $qs)}" title="Previous page">‹</a></td> </xsl:if> <td>Page</td> <td><input type="number" name="page" id="page" min="1" > <xsl:choose> <xsl:when test="$page=1"> <xsl:attribute name="value">1</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="value"> <xsl:value-of select="$currentPageNumber" /> </xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:attribute name="max"> <xsl:value-of select="$numberOfPages"/> </xsl:attribute> </input></td> <td>of <xsl:value-of select="$numberOfPages"/></td> <!-- next page --> <xsl:if test="$page * $resultsPerPage < count($matchedNodes)"> <td class="pager-next"><a class="next" href="{concat('?page=', $page + 1, $qs)}" title="Next page">›</a></td> </xsl:if> </tr> </table> </div> </form>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Pagination using input onchange
I'm creating some pagination for my website, and want to use an input-element to navigate between pages.
Like the following example:
Would this be possible to do with XSLT?
Here's what I have so far, I can't figure out where to put the URL changing code:
I've also posted this a jQuery question on Stackoverflow:
http://stackoverflow.com/questions/13150264/jquery-pagination-go-to-page-on-input-value-change
Any help would be greatly appreciated.
Cheers, JV
I got it working using the following:
is working on a reply...