Forum

Thread tagged as: Question, Problem, Forms

Checkbox data not being sent in submission

I have 3 checkboxes in my form. They are setup like below. When I check any of the boxes, none of the data is being sent to the submission. All the rest of the form fields are sending the data fine

<perch:input type="checkbox" id="pm_session" value="true" /> <perch:label for="pm_session">PM Session RSVP</perch:label>

The data received in the submission. The 3 checkboxes are located directly before Special Requirements.

First Name: Home
Last Name: Simpson
Title: Plant Technician
Company: Springfield Power Plant
Address: 346 Main St
City: Springfield
State: OR
Zipcode: 97477
Phone: 2122222222
Email: home2@simpson.com
Special Requirements: 
Michael Sharer

Michael Sharer 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Does it make a difference if you add the missing label attribute?

Where are you suggesting adding the label attribute? To the <perch:input /> tag?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's right.

For example: <perch:input type="checkbox" id="pm_session" value="true" label="PM Session RSVP" />

--or--

<perch:input type="checkbox" id="pm_session" value="true" > <perch:label for="pm_session">PM Session RSVP</perch:label></perch:input>

Drew McLellan

Drew McLellan 2638 points
Perch Support

 <perch:input type="checkbox" id="pm_session" value="true" label="PM Session RSVP" />

Bottom line is you need both tags for this to work and display properly

The label in the input tag for the data to be collected The label tag to show the label on the form

<perch:input type="checkbox" id="pm_session" value="true" label="PM Session RSVP" /> <perch:label for="pm_session">PM Session RSVP</perch:label>

Thank you for your assistance.

Just to clarify. Did something change in the forms app to where the following would no longer work

<perch:input type="checkbox" id="credit" value="true" /><perch:label for="cecredit">I would like Credit</perch:label>

This is in a form of mine from when I first started using Perch, and it collected data no problem.

Thanks for the insight.

Drew McLellan

Drew McLellan 2638 points
Perch Support

As per the documentation, the label attribute on the input tag is for displaying the result in the admin. It's completely different from the label tag which is for the HTML label.

This hasn't changed.

Thanks again Drew.