Home › Forums › Quform WordPress › Get Checkboxes Value
- This topic has 10 replies, 2 voices, and was last updated 11 years ago by Ally.
- AuthorPosts
- January 8, 2014 at 6:53 am #8124chrisfrickParticipant
Hello
I created an own email-content.php and autoreply-content.php, but now I have only one Problem.
I got at the end of the form 2 Checkboxes and need to output if they’r checked or not.How I do this?
Thanks!
ChrisJanuary 8, 2014 at 8:35 am #8125chrisfrickParticipantokay no other problem 🙂
- This reply was modified 11 years ago by chrisfrick.
January 9, 2014 at 11:49 am #8147AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 9, 2014 at 12:11 pm #8157chrisfrickParticipantHmm.. But I got 2 Checkboxes…
Option 1
Option 2With this solution I only know… if 1 Checkbox is checked or not, but I need to know if Option 1 or Option 2 is checked.
Thanks
ChrisJanuary 9, 2014 at 12:33 pm #8162AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 9, 2014 at 12:46 pm #8163chrisfrickParticipantI tried this…
<?php
if (in_array(‘1’, (array) $form->getElement(‘iphorm_5_1’)){
echo “Option 1!”;
}
?>But dind’t work and it’s the right ID, the Value of Option 1 is ‘1’ as well.
Other idea?
January 9, 2014 at 12:48 pm #8164AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 9, 2014 at 12:52 pm #8165chrisfrickParticipant
<?php if (in_array('1', (array) $form->getValue('iphorm_5_1')) : ?>
Option 1 is ticked
<?php endif; ?>But doesn't work :/
January 10, 2014 at 5:12 pm #8190AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 12, 2014 at 3:31 pm #8214chrisfrickParticipantHere you go…
array(1) { [0]=> string(1) “2” }
Greets
ChrisJanuary 13, 2014 at 8:51 am #8224AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.