Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1846

[PATCH] BooleanField and radio do not send on-value-changed at the rigth time with IE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.9
    • None
    • Blocks: Forms
    • None
    • Patch available

    Description

      BooleanField and radio list do not send on-value-changed event when the value changed but when the widget loose focus with IE.
      So with ajax mode and submit-on-change='true', the form is submitted only when the widget lost the focus.
      Here is a patch to use event onclick rather than on value change :


      --- forms-field-styling.xsl 2006-05-09 14:53:40.014409000 +0200
      +++ forms-field-styling.xsl 2006-05-09 14:45:01.499752000 +0200
      @@ -91,11 +91,20 @@
             +-->
         <xsl:template match="fi:*" mode="styling">
           <xsl:apply-templates select="fi:styling/@*" mode="styling"/>
      -
           <!-- Auto submit on fields which are listening -->
      - <xsl:if test="@listening = 'true' and not(fi:styling/@submit-on-change ='false') and not(fi:styling/@onchange) and not(fi:styling/@list-type = 'double-listbox')">
      - <xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
      - </xsl:if>
      + <xsl:choose>
      + <xsl:when test="name() = 'fi:booleanfield' or fi:styling/@list-type = 'radio' ">
      + <xsl:if test="@listening = 'true' and not(fi:styling/@submit-on-change = 'false') and not(fi:styling/@onchange) and not(fi:styling/@list-type = 'double-listbox')">
      + <xsl:attribute name="onclick">forms_submitForm(this)</xsl:attribute>
      + </xsl:if>
      + </xsl:when>
      + <xsl:otherwise>
      + <xsl:if test="@listening = 'true' and not(fi:styling/@submit-on-change = 'false') and not(fi:styling/@onchange) and not(fi:styling/@list-type ='double-listbox')">
      + <xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
      + </xsl:if>
      + </xsl:otherwise>
      + </xsl:choose>
      +

           <xsl:if test="@state = 'disabled'">
             <xsl:attribute name="disabled">disabled</xsl:attribute>

      Attachments

        Activity

          People

            s.gianni Simone Gianni
            vincent.demay@anyware-tech.com Vincent Demay
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: