0 users online. Create an account or sign in to join them.Users

Search

I have a form with a few checkboxes and am having trouble getting these values to save, while the rest of the text input fields work fine.

Here's the truncated version of the form code:

<form action="" method="post">

<label>Individual</label>
<input type="checkbox" name="fields[individual]" value="{events/save-volunteer-form/post-values/individual}"/>

<input id="submit" type="submit" name="action[save-volunteer-form]" value="Send" class="box button" /></form>

Is there something particular I need to add when saving input from checkboxes?

@lbradford, check the thread "Checkbox post-values". This might be a help to you.

If you want to save the values of input checkboxes I tend to add a hidden input field above each input checkbox with a default value of 'No' and target the same name attribute as the visible one.. this way, if the users doesn't enter a value it fallsback to 'No' but if they enter a value.. the visible input checkbox overrides my hidden ones as it gets fired after the hidden input for each field.

Make sense?

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