Jump to content

Multiples checkeds in checkbox of helperform


rafapas22

Recommended Posts

Hello.

 

I have this code in a helperform

		        $options = array(
          array( 'id_option' => '1', 'name_option' => 'Awaiting check payment'),          
          array( 'id_option' => '2', 'name_option' => 'Payment accepted'),          
          array( 'id_option' => '3', 'name_option' => 'Processing in progress'),          
          array( 'id_option' => '4', 'name_option' => 'Shipped'),          
          array( 'id_option' => '5', 'name_option' => 'Delivered'),          
          array( 'id_option' => '6', 'name_option' => 'Canceled'),          
          array( 'id_option' => '7', 'name_option' => 'Refunded'),          
          array( 'id_option' => '8', 'name_option' => 'Payment error'),          
          array( 'id_option' => '9', 'name_option' => 'On backorder (paid)'),          
          array( 'id_option' => '10', 'name_option' => 'Awaiting bank wire payment'),          
          array( 'id_option' => '11', 'name_option' => 'Awaiting PayPal payment'),          
          array( 'id_option' => '12', 'name_option' => 'Remote payment accepted'),          
          array( 'id_option' => '13', 'name_option' => 'On backorder (not paid)'),          
          array( 'id_option' => '14', 'name_option' => 'Awaiting Cash On Delivery validation'),          
        );


					array(
						'type'    => 'checkbox',                   // This is an <input type="checkbox"> tag.
						'label'   => $this->l('States'),          // The <label> for this <input> tag.
						'desc'    => $this->l('Order states'),  // A help text, displayed right next to the <input> tag.
						'name'    => 'options',                    // The content of the 'id' attribute of the <input> tag.
						'values'  => array(
							'query' => $options,                     // $options contains the data itself.
							'id'    => 'id_option',                  // The value of the 'id' key must be the same as the key                                             // for the 'value' attribute of the <option> tag in each $options sub-array.
							'name'  => 'name_option'                        // The value of the 'name' key must be the same as the key
                            ),
					),

but i have a problem, because I don't know how marked two options od checkbos like marked, like checked, and in documentation not explain this feature.

 

Any expert developer can help me? please

 

Regards

Edited by rafapas22 (see edit history)
Link to comment
Share on other sites

Reading the code, it seems you need to put the values in the $this->fields_value array:

		<input type="checkbox" name="{$id_checkbox}" id="{$id_checkbox}" class="{if isset($input.class)}{$input.class}{/if}"{if isset($value.val)} value="{$value.val|escape:'html':'UTF-8'}"{/if}{if isset($fields_value[$id_checkbox]) && $fields_value[$id_checkbox]} checked="checked"{/if} />
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...