diff options
-rw-r--r-- | gentoobrowse/form.xslt | 6 | ||||
-rw-r--r-- | gentoobrowse/present/search.xml | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gentoobrowse/form.xslt b/gentoobrowse/form.xslt index 14bd459..e24c8ae 100644 --- a/gentoobrowse/form.xslt +++ b/gentoobrowse/form.xslt @@ -19,6 +19,7 @@ <input> <xsl:attribute name="type"><xsl:value-of select="@type" /></xsl:attribute> <xsl:attribute name="name"><xsl:value-of select="@name" /></xsl:attribute> + <xsl:attribute name="id">form_<xsl:value-of select="@name" /></xsl:attribute> <xsl:attribute name="value"> <xsl:value-of select="dyn:evaluate(@xslvalue)" /> </xsl:attribute> @@ -36,6 +37,11 @@ </tr> </table> </form> + <xsl:if test="@autofocus != ''"> + <script type="text/javascript"> + document.getElementById('form_<xsl:value-of select="@autofocus" />').focus(); + </script> + </xsl:if> </xsl:template> </xsl:stylesheet> diff --git a/gentoobrowse/present/search.xml b/gentoobrowse/present/search.xml index 716dc07..0c61f35 100644 --- a/gentoobrowse/present/search.xml +++ b/gentoobrowse/present/search.xml @@ -2,7 +2,7 @@ <view name="search" root="gentoo" style="search.xslt" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:project2="http://project2.randomdan.homeip.net"> <project2:rawview> - <form caption="Search" submit="Search" action="/search" method="get"> + <form caption="Search" submit="Search" action="/search" method="get" autofocus="criteria"> <input type="text" caption="Criteria" name="criteria" xslvalue="/gentoo/project2:params/project2:param[@name='criteria']" /> </form> |