Search

Hello, it's a very simple question again :$

I try to make a form that can input some messages from the front end, but there is something wrong that I can get nothing from the event.

here's my xml

<xsl:template match="data">
<div id="wrapper">
  <div id="boardimg"><img src="{$workspace}{board/entry/boardimg/@path}/{board/entry/boardimg/filename}"  /></div>
  <div id="board_content">
    <form id="messagesboard" method="post" action="{$root}/board" enctype="multipart/form-data">
      <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />

        <p><label>Title</label><input name="fields[title]" /></p>       
        <label>Content</label><p><textarea name="fields[content]" rows="10" cols="100" value="I want to say..."></textarea></p>

      <input name="fields[date]" type="hidden" value="{$today} {$current-time}" />
      <input name="action[submit]" type="submit" id="submit" value="Send" />
    </form>  
  </div>

</div>
</xsl:template>


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

and here's my ?debug

<board>
  <section id="2" handle="board">board</section>
     <entry id="2">
           <boardimg size="977 KB" path="/images" type="image/png">
               <filename>batman-06.png</filename>
               <meta creation="2011-04-11T12:40:26+08:00"
 width="1024" height="768" />
           </boardimg>     
     </entry>
</board>

Actually I copy the coding from the tutorial. There are some coding I don't understand:

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

I just try to imitate the coding.

Is anyone can tell me where I'm wrong? And how should I correct the coding??

Thank you so much!!!!

Have you created the event? Is it attached to the page? The name of the submit button looks wrong, check the event example code.

Also action="{$root}/board" could be wrong as you'll be redirected to {$root}/board/, possibily turning your POST request into a GET request.

While developing you should change the action attribute to ?debug so you can see what's going on in your XML after you've submitted the form.

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