Search

Hello dear Symphony users,

I need some help with a final bug that has been eluding me, before I can release my site. It has to to with the contact form. This is my first site made in Symphony, so I have been re-using some parts found on the net and contained in the default workspace.

My problem is that I'm not able to have my contact form pass it's senders gender information from the radio input element.

I've been trying several types of fields in my messages section (select box, checkbox) and sending the data much the same way as it does the textfields and areas. I'm using a Save Message Event to put the data to the database. I didn't write much of this myself, and am unable to look deeper into what's happening in the event.

I've been looking into the better forms extension on this site. But I'm very curious if this may be easily fixed and how.

It sounds like a simple thing. Are the other valued posted correctly? Could you post your XML/XSLT Siem?

Like so? I've put it here. http://pastie.org/2815236

I do not have the time to really look into it now but I did notice a couple of strange things.

  1. You should make the value of your [gender] radio buttons statric (Meneer or Mevrouw).
  2. The checked attribute should be set dynamically. E.g. create your options as:

    <input type="radio" name="fields[gender]" value="Meneer"> <xsl:if test="events/save-message/post-values/gender = 'Meneer'"> <xsl:attribute name="checked">checked</xsl:attribute> </xsl:if> </input> <input type="radio" name="fields[gender]" value="Mevrouw"> <xsl:if test="events/save-message/post-values/gender = 'Mevrouw'"> <xsl:attribute name="checked">checked</xsl:attribute> </xsl:if> </input>

  3. I'm not sure why you need those send-email[…] @hidden fields below but your send-email[body] field is missing gender...

  4. I don't think you need the hidden fields but, when you do, the value should not be value="fields[gender]" but value="{fields[gender]}" etc.

Sorry I could not take a long look but try and fix some of the things above, and look into simplifying the form (leave out the hidden send-email[] fields, etc.

Good luck.

Okay thanks for the quick feedback David. Don't rush to it, i'll take a look at it in the next few days. Thanks for the advice.

Hey David,

just bumping this to tell you thanks for giving me the solution! That's one thing I like about symphony, the community. So great job. I'm still figuring out how most of this stuff works by trial-and-error. So i made those adjustments and added a new select box to my section, and it now displays the gender neatly.

Somehow I'm sensing though you're not exactly keen on those send-email[…] hidden fields. I'm using it to send a direct e-mail with that info to the site-owner adres. I was thinking I should add the clients main maildomain there, and make it forward to all users from cpanel. Do you propose I use another way to inform the authors of this site directly of the inquiry?

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