Saving checkbox and radio button values in table

Home Forums Quform WordPress Saving checkbox and radio button values in table

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31828
    oivanr
    Participant

    I am trying to save each value o a checbox or radio button value in a separate field in a table. What I had done is this:
    $valores = array(); // valores de las opciones de grados
    $nivel = $form->getValue(‘quform_1_46′);// variable que determina si es primaria o secundaria

    if ($nivel===’PRIMARIA’){
    $element = $form->getElement(‘quform_1_48’);
    } else {
    $element = $form->getElement(‘quform_1_49’);
    }

    foreach ($element->getOptions() as $option) {
    $valores[] = $option[‘value’];
    }

    Where $nivel is a select menu which say what element (checkbox group in this case) get to save.
    then I had created and array whose name is $valores, where I store the values of each option, the problem is that I save all the values eventhough they are not checked. What can I do to save only the checked values?
    Thanks for your help

    #31833
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2020 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy