We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40092
    • 265 Posts
    I have a few checkboxes, that based on 1 or 0 (INT) are checked or unchecked. (for setting active and other stuff).
    But when specifying input TV type as checkbox-TV, it lists as a textfield.

    Anyone an idea what i'm overlooking here?

    Regards
    Robin
      • 4172
      • 5,888 Posts
      input TV type: checkbox

      doesn't do it?

      btw: you can also create switch-buttons in the grid to switch between different options, directly from grid.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 40092
        • 265 Posts
        Ah, i had to lose the -TV behind it. Now the checkbox appears, that's good. But how do i tell them how to "behave". I have a certain amount of checkboxes that have value '1' so should be checked but aren't.

        btw: you can also create switch-buttons in the grid to switch between different options, directly from grid.
        That is interesting, can i read up on that somewhere?
          • 4172
          • 5,888 Posts
          you will need inputOptionValues like: yes==1
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 40092
            • 265 Posts
            Ah, that works like a charm indeed. I'm assuming that the same goes for radio's ?
              • 40092
              • 265 Posts
              What about multiple checkboxes per field?

              Let's say i have 5 options wich could all be selected but also 2 of 5 or none etc.

              I know that in Input Options Values i can separate them easilly by adding || between, but how to let them checked/unchecked properly.

              The values are stored like 1;2;4;, number values separated by a semicolon. Normally i would just explode this in php, but that don't fly in migxdb, and should probably do such a thing with JSON wich i know exactly 0,0 about:-)
                • 4172
                • 5,888 Posts
                they should be stored like any other multi-select-TV in modx separated by || - (doublepipes) in the db.
                aren't they?
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 40092
                  • 265 Posts
                  They aren't.

                  I am upgrading a big Evolution site to Revolution, and part of that is a custom manager that handles all off my trips and vacatations. (background info, so you have a picture)

                  As they are now in Evolution, they are checkboxes like this:

                  		$content .=	'<tr>
                  			  <td><strong>Soort reis:</strong></td>
                  			  <td>';
                  	
                  	                  $types = explode(';', $row->Soorten);
                      
                  
                      
                      $soorten_sql = mysql_query("SELECT * FROM soorten");
                      while ($soort_row = mysql_fetch_object($soorten_sql)) {
                          $selected = '';
                          if (in_array($soort_row->id,$types)) {$selected = "CHECKED";}
                          $content .= '<input style="width: 20px;" name="soorten[]" type="checkbox" value="'.$soort_row->id.'" '.$selected.'> '.$soort_row->name.' ';
                      }
                  
                    • 4172
                    • 5,888 Posts
                    definitiv:

                    multi-checkboxes should be stored as doublepipe-delimited values.
                    And should work without any additional coding.

                    on update the array is converted to a doublepipe-delimited list.
                    on reading for the update-form the delimited-list is converted back to an array and the checkboxes should be checked.

                    If you have ; delimited lists, I would replace all of them with ||
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 40045
                      • 534 Posts
                      Quote from: thapriest86 at Mar 25, 2013, 08:37 AM

                      btw: you can also create switch-buttons in the grid to switch between different options, directly from grid.
                      That is interesting, can i read up on that somewhere?

                      also interested =)