Author:
nickdunn
Version:
1.6
Released:
22 February 2010
Category:
Forms

Closed#1: Select Boxes lose post-back value

It appears that if a select box has the section parameter set, then the post-back value is not selected when a form is submitted with errors. Instead it defaults to the first one, as if a option was never selected.

This behavior does not occur with other forms that do not utilize the section parameter.

Looks like the if statement on line 718 should refer to the $postback-value directly, like so:

<xsl:if test="($event and $option-value=$postback-value) or (not($event) and $option-value=exsl:node-set($initial-value)/*)">
    <xsl:attribute name="selected"><xsl:text>selected</xsl:text></xsl:attribute>
</xsl:if>

Thanks for spotting this, Lewis. It needs to check both the string value and check by converting to a nodset for when the result of form:postback-value contains a <value> element. Have made an update, so see if this works please :-)

http://github.com/nickdunn/form-controls/tree/1.4

Thanks Nick, it looks like that solves the problem.

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details