jeudi 1 septembre 2016

How to get value in checkbox Prestashop?

i have a function renderForm

$this->fields_form = array(
        'tinymce' => true,
        'legend' => array(
            'title' => $this->l('Category'),
            'icon' => 'icon-folder'
        ),
        'input' => array(

            array(
                'type' => 'checkbox',
                'label' => $this->l('Group access'),
                'name' => 'checkBox',
                'values' => array(
                    'query' => Group::getGroups($this->id_lang),
                    'id' => 'id_group',
                    'name' => 'name'
                ),
                'unidentified' => $unidentified_group_information,
                'guest' => $guest_group_information,
                'customer' => $default_group_information,
                'info_introduction' => $this->l('You now have three default customer groups.'),
                'hint' => $this->l('Mark all of the customer groups which you would like to have access to this category.')
            )
        ),
        'submit' => array(
            'title' => $this->l('Save'),
            'class' => 'btn btn-large btn-success pull-right'
        )
    );

i need get value of checkbox for insert into database

i print_r($_POST) it show checkBox_1 => on, checkBox_2 => on

this class extends ModuleAdminController

thanks!!!




Choosing checkboxes in another column

I am trying to use this code that I found somewhere online for linking my checkboxes to another cell

Sub CheckboxValue_Method1() Dim cbValue As Long cbValue = ActiveSheet.Shapes("Check Box 1").ControlFormat.Value End Sub

This works perfectley as long as I have just one column of checkboxes. If I want to use the same code for choosing the checkboxes on second column how should I edit the code? I don't want to use a Master checkbox.




retrieving value of checkbox in react.js

I am quite new to react.js and i want to retrieve value of my checkbox, when it is checked. ... can somebody guide me how to retrieve value of checkbox, when it is checked.

I am using this "http://ift.tt/2bEi2Si". my code looks like this.

          <div className="user_box">
                    {
                        check.map((values , i)=>{


                            return   <Checkbox
                                name = "checkbox"
                            onChange={this.checkvalue.bind(this)}
                            value={values.username}
                            />

                        })
                    }
                        </div>

my function

      checkvalue(e){

         //var all_users = [];
         //var value = this.checkbox.value;
        //all_users.push(value);
       //console.log(all_users);

       console.log('checkbox checked:', (e.target.checked));

   }

still not getting how to retrieve value of it...

please guide me, if you guys some better idea also. thanks




P Element copy to Input value and just one select

First name repeats and other names can not be selected, where is the problem? Also, how do I make the choice just one name?

  

function copyTextValue(bf) {
 if(bf.checked)
 var text1 = document.getElementById("names").innerHTML;
 else
 text1='';
 document.getElementById("Name2").value = text1;
 document.getElementById("Name3").value=text1; 
 }
<b>Names</b><hr/>
 

<input type="checkbox" name="check1" onchange="copyTextValue(this);"/><p id='names'>James</p>
<input type="checkbox" name="check1" onchange="copyTextValue(this);"/><p id='names'>Emre</p>
<input type="checkbox" name="check1" onchange="copyTextValue(this);"/><p id='names'>Kate</p>
<input type="checkbox" name="check1" onchange="copyTextValue(this);"/><p id='names'>Berkay</p>

<hr/><b>Form</b><hr/>
<input id="Name2">
<input id="Name3">

http://ift.tt/2bK3Ozy




Uploading multiples Images on checked checkbox option

I have a problem in uploading multiple images for checked checkbox you can check the below image

enter image description here

My requirement is that when i checked color option their image should be uploaded & image will be multiple like Red can have 2 images & Pink can have 5 images and save same in MYSQL DB.

I have written below code for this

 if(isset($_REQUEST['colorId'])){
    $counter = count($_REQUEST['colorId']); 
   for($i=0;$i<=$counter;$i++){
        echo $_REQUEST['colorId'][$i];
        foreach($_FILES['colorFile']['name'] as $key => $value ){
                $file_size =$_FILES['colorFile']['size'];
                $file_tmp =$_FILES['colorFile']['tmp_name'];
                $file_type=$_FILES['colorFile']['type'];    
                if($_FILES['colorFile']['name']!=''){
                       // INSERT QUERY
                        $desired_dir=$folder.$_FILES['colorFile'] 
                       ['name'];                                     
                     move_uploaded_file($file_tmp,$desired_dir);
                            }
                        }

                        }               
                    }

Can anyone help me.. for this?? Data inserting not happening properly




Checked All Child Issue

Actually I am Not getting size when i am printing Toast in checkedbox Checked Event in android.

Here is my Code on parent checkbox in android if i will get the size the problem will automatically solved.

This code is declared in custom Adapter.

public void onBindViewHolder(final MyViewHolder holder, int position) {
    //Toast.makeText(context, "Key: " + position, Toast.LENGTH_LONG).show();
    String val = allCityList.get(position);
    Integer cnt = val.split("-").length;

    if (cnt > 1) {
        val = val.split("-")[1];
        holder.chkbox_parent.setText(val);
        holder.chkbox_parent.setTag("State");
        holder.chkbox_parent.setTypeface(null, Typeface.BOLD);

        stateTag = val;
    } else {
        val = val.split("-")[0];
        holder.chkbox_parent.setText(val);
        holder.chkbox_parent.setTag(stateTag);
    }

holder.chkbox_parent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
            CheckBox chk = (CheckBox) holder.chkbox_parent;

            if (chk.getTag().equals("State")) {
                String state = chk.getText().toString();
                Toast.makeText(context, state, Toast.LENGTH_LONG).show();
                try {
                    RecyclerView rv1 = holder.rvParent;
//                        Toast.makeText(context, ""+rv1.getTag(), Toast.LENGTH_LONG).show();
                    for (int i = 0; i < rv1.getChildCount(); i++) {
                        Log.e("hello......", ""+rv1.getChildCount());
                        CheckBox cb;
                        cb = (CheckBox) rv1.getChildAt(i).findViewById(R.id.chkbox_parent);
                        Toast.makeText(context, "" + cb.getText(), Toast.LENGTH_LONG).show();
 //                if (state.equals(cb.getTag()))
//                    cb.setChecked(chk.isChecked());
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    });

Issue is coming on recyclerview ie rv.getchildcount




WPF bind ComboBox with CheckBox

I would like to bind a ComboBox with a CheckBox so that the ComboBox is enabled when the CheckBox is not checked. Can I do that directly in the xaml file, without adding any additional variable in the code?
In the code below, myComboBox is enabled when myCheckBox is ckecked.

<ComboBox Name="myComboBox" SelectedIndex="0" 
     IsEnabled="{Binding ElementName=myCheckBox, Path=IsChecked}">