Search

Hi Folks,

I was following the "Say Hello to Symphony Tutorial" and everything really was fine up to step 6. I followed the directions perfectly (I thought), but the form output is very strange. The form lays out ok, but this text appears in the Greeting Content textarea box:

    <input name="fields[date]" type="hidden" value="2011-07-30 21:10"/>
    <input name="action[submit-greeting]" type="submit" id="submit" value="Submit"/>
  </form>
</div>

could you paste your entire template?

Sure - it should be exactly what was published in the tutorial...but here it is from the actual editor:

<?xml version="1.0" encoding="UTF-8"?>

    <h2>Leave Your Greeting Here</h2>
    <xsl:apply-templates select="events/submit-greeting"/>

    <label>Greeting Title</label>
    <input name="fields[greeting-title]" type="text" />

    <label>Language</label>
    <select name="fields[language]">
        <option value="Chinese">Chinese</option>
        <option value="Spanish">Spanish</option>
        <option value="English">English</option>
        <option value="Arabic">Arabic</option>
        <option value="Hindi">Hindi</option>
        <option value="Bengali">Bengali</option>
        <option value="Portuguese">Portuguese</option>
        <option value="Russian">Russian</option>
        <option value="Japanese">Japanese</option>
        <option value="German">German</option>
        <option value="Javanese">Javanese</option>
        <option value="Punjabi">Punjabi</option>
        <option value="Wu">Wu</option>
        <option value="Telugu">Telugu</option>
        <option value="Vietnamese">Vietnamese</option>
        <option value="Marathi">Marathi</option>
        <option value="French">French</option>
        <option value="Korean">Korean</option>
        <option value="Tamil">Tamil</option>
        <option value="Italian">Italian</option>
    </select>

    <label>Greeting Content</label>
    <textarea name="fields[greeting-content]" rows="15" cols="50"></textarea>

    <input name="fields[date]" type="hidden" value="{$today} {$current-time}" />

    <input name="action[submit-greeting]" type="submit" id="submit" value="Submit" />
</form>

Must be a limit to the post above...here is the rest:

</xsl:template>

<xsl:template match="events/submit-greeting">
    <p>
        <xsl:attribute name="class"><xsl:value-of select="@result"/></xsl:attribute>
        <xsl:value-of select="message"/>
    </p>
</xsl:template>

</xsl:stylesheet>

Temporarily solved: By puttting default text before the end tag. everything functions normally:

<textarea name="fields[greeting-content]" rows="15" cols="50">Type Content Here</textarea>

No telling why this works this particular way. I'm on a Mac OS X 10.7 (Lion) with MAMP 2.0 as the webserver, if that makes any difference (it shouldn't)

If your output mode is XML, an empty textarea element will be output as

<textarea />

While this is perfect XML, in HTML the textarea element should not be self-closing. If it is, this triggers the error handling of some renderers (browsers). They try to "repair" this because they think it's a mistake. So the rendering engine leaves the element open which results in the strange effect you described.

I experienced this in Safari, but it might be a problem to other browsers, too (probably Chrome, which works with the Webkit engine as well). Google tells me that it's also a problem to Internet Exploder.

So your "temporary solution" nailed it: For textareas, you must put some content between the opening and the closing tag.

Create an account or sign in to comment.

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