edit/add.php how to create "radio" button without any value = none
Permalink
CUSTOM BLOCK: I want to use some radio button inside form.php to customize the view.php.
"THE PROBLEM" - i want in the select also the "none" option (var = null).
Inside edit/add.php (the form) i create array match the DB decleraion with option for "space around image" (works great)
Inside db.xml
Inside view.php i have something like this:
(medium / large space) are great, but If the user chose "no-space" the class need to be empty "" (No extra style)
Of course i can add "IF" for "'no-space' " option (or wrote some "un-declare" css class), "but this is not modular or clean, so mabye her i will find good solution for this
"THE PROBLEM" - i want in the select also the "none" option (var = null).
Inside edit/add.php (the form) i create array match the DB decleraion with option for "space around image" (works great)
<?php $filterSpaceAroundImageOptions = array( 'no-space' => t('Image without any spacing'), 'small-space' => t('Image with small space around'), 'big-space' => t('Image with large space around'), ...rest of the code
Inside db.xml
<field name="filterSpaceAroundImageOption" type="string" size="50" comment="('no-space','small-space', 'big-space')"> <default value="no-space"/> </field>
Inside view.php i have something like this:
<img class="some-class <?php echo filterSpaceAroundImageOption ?>"....rest of the code
(medium / large space) are great, but If the user chose "no-space" the class need to be empty "" (No extra style)
Of course i can add "IF" for "'no-space' " option (or wrote some "un-declare" css class), "but this is not modular or clean, so mabye her i will find good solution for this