Search

Hey, I cant get any events to work, I’ve attached the Event to the page. I’ve set 'display_event_xml_in_source' to 'yes' but all I keep getting is:

<!-- 
<events>
    <login-info logged-in="true" id="1" user-type="developer" primary-account="yes">
        <name>Studio Forty9</name>
        <username>admin</username>
        <email>eoghan@studioforty9.com</email>
        <author-token>9a4a7440</author-token>
        <default-section id="3" handle="pages">Pages</default-section>
    </login-info>
</events>
-->

My Form:

...
<xsl:if test="events/send-cv/@result">
  <xsl:choose>
    <xsl:when test="events/send-cv/@result = 'success'">
      <p class="success">Your C.V. has been saved successfully. We will contact you shortly.<br /><em>Newman Greene</em></p>
    </xsl:when>
    <xsl:otherwise>
      <p class="errors">The system encountered errors while attempting to save your notice. Please check that all the required fields have been filled out correctly.</p>
    </xsl:otherwise>
  </xsl:choose>
</xsl:if>

<form id="send-cv-form" method="post" action="" enctype="multipart/form-data">
  <fieldset>
    <div class="form-element clearfix">
      <label for="name">Name:</label>
      <input type="text" id="name" name="fields[author]" value="" class="textbox" />
    </div>
    <div class="form-element clearfix">
      <label for="email">Email:</label>
      <input type="text" id="email" name="fields[email]" value="" class="textbox" />
    </div>
    <div class="form-element clearfix">
      <label for="phone">Phone:</label>
      <input type="text" id="phone" name="fields[phone]" value="" class="textbox" />
    </div>
    <div class="form-element clearfix">
      <label for="file">File:</label>
      <div class="cabinet"><input type="file" id="file" name="fields[file]" class="file" /></div>
    </div>
    <div class="form-element clearfix">
      <label for="message">Message</label>
      <textarea id="message" name="fields[message]" rows="15" cols="20"></textarea>
    </div>
    <input type="hidden" name="MAX_FILE_SIZE" value="5242880" />
    <input type="hidden" name="send-email[from]" value="fields[email]" />
    <input type="hidden" name="send-email[subject]" value="You are being contacted" />
    <input type="hidden" name="send-email[body]" value="fields[message]"  />
    <input type="hidden" name="send-email[recipient]" value="admin" />
    <div class="form-send clearfix">
        <label class="instructions">Please read our privacy policy and terms &#38; conditions before submitting the form.</label>
        <input id="btn-send-your-cv" class="button" type="submit" name="action[save-contact-form]" value="" />
    </div>
  </fieldset>
</form>
...

It looks like it’s not been triggered because you need to change the name of your submit:

<input id="btn-send-your-cv" class="button" type="submit" name="action[save-contact-form]" value="" />

Should correspond to the event (doublecheck its name):

<input id="btn-send-your-cv" class="button" type="submit" name="action[send-cv]" value="" />

Ah, I feel quite stupid now.! I changed the name after and never changed the html, :redface

Cheers Lewis

No worries.

Another handy trick is to submit the event to ?debug (changing your form @action) which will show the Event XML in-situ.

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