1 Reply Latest reply on Aug 2, 2017 8:06 AM by pdh

    Filemaker API / Carriage return for checkboxes



      Filemaker API / Carriage return for checkboxes



      I created a small website thanks to PHP Site Assistant.

      My "Addrecord" page has a field with checkboxes. But all the checkboxes are on the same line... and I would like one checkbox per line.

      How could I modify the following code for this?

      <td class="field_data">
          <?php $fieldName = 'Int_Method';?>
          <?php $fieldValue =          $record->getField('Int_Method', 0) ; ?>
          <?php getInputChoices("checkbox", $layout-> getValueListTwoFields('Plan_Int_Method_Guill', (isset($master_record)) ? $master_record->getRecordId() : $record->getRecordId()), $fieldValue, getFieldFormName($fieldName, 0, $record, true, 'CHECKBOX', 'text'), 'text', $submitDateOrder);?>

      My checkbox list is called 'Plan_Int_Method_Guill' as you can see, and I don't know how to split it into several lines...

      Thank you for your help!


        • 1. Re: Filemaker API / Carriage return for checkboxes

          This is old but I just came across it and have a fix, just in case anybody else has the same problem. In fmview.php in your project folder, at the bottom, you can modify the function getInputChoices. Insert a ."<br>" as below at the end of the line that creates each check box item. This puts each checkbox on a new line. Note, this affects all checkboxes in the project. If you don't want that, duplicate the whole function and modify that. Then just call that function instead.


          if ($type == "checkbox"){

                      echo "<input type='$type'name='$fieldName" . "[]'" . "value='$storedValue'$selected>$eachvalue"."<br>";


                      echo "<input type='$type'name='$fieldName' value='$storedValue'$selected>$eachvalue";




          1 of 1 people found this helpful