0

I am not able to check and uncheck a Checkbox value and save in edit page in Magento2:

My input field:

 <label class="check_tick">Shipping
                    <input type="checkbox" name="product[shiping]" id="shiping" value= 1 <?php if($product_coll->getShipingValue() == 1){ echo "checked='checked'"; }?> class="checkboxvalue">
                    <span class="checkmarkng"></span>
                </label>

Any help would be appreciated.

7
  • May I know where you defined this variable $product_coll Commented Mar 11, 2020 at 11:08
  • I am getting the value in same file.. Commented Mar 11, 2020 at 12:13
  • try this one <label class="check_tick">Shipping <input type="checkbox" name="product[shiping]" id="shiping" value= "1" <?php if($product_coll->getShipingValue() == 1){ echo "checked='checked'"; }?> class="checkboxvalue"> <span class="checkmarkng"></span> </label> Commented Mar 11, 2020 at 12:15
  • It is not working. Commented Mar 11, 2020 at 12:28
  • If I use the input type as "text" it is working, but for checkbox is not working. Commented Mar 11, 2020 at 12:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.