Gary Larsen wrote:
> I need to use tab styling with groups since there are so many widgets
> on the form. The issue is that when a use submits the form, a
> validation error could occur on a non-active tab. To the user the
> submit button is just not working.
>
> Has anyone been able to come up with a solution to work around this
> issue?
I'm not sure if it's applicable to Ajax, but following our internal
usability guidelines we implemented this:
<xsl:template match="fi:form-template">
<xsl:apply-imports/>
<xsl:if test=".//fi:validation-message">
<script type="text/javascript">
<xsl:text>alert('The following data is missing or incorrect:\n</xsl:text>
<xsl:for-each select=".//fi:validation-message">
<xsl:text>\n</xsl:text>
<xsl:value-of select="local:capitalize(../@id)"/>
<xsl:if test="text()">
<xsl:text> (</xsl:text>
<xsl:value-of select="local:addslashes(normalize-space(.))"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>')</xsl:text>
</script>
</xsl:if>
</xsl:template>
It generates a javascript popup that informs the user about the fields
that need attention. Here are the helper functions:
<func:function name="local:capitalize">
<xsl:param name="s"/>
<func:result select="concat(translate(substring($s, 1, 1),
'abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
substring($s, 2))"/>
</func:function>
<func:function name="local:addslashes">
<xsl:param name="s"/>
<xsl:choose>
<xsl:when test='contains($s, "'")'>
<func:result select='concat(substring-before($s, "'"),
"\'",
local:addslashes(substring-after($s,
"'")))'/>
</xsl:when>
<xsl:otherwise>
<func:result select="$s"/>
</xsl:otherwise>
</xsl:choose>
</func:function>
HTH
Tobia
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]