0

I have a checkbox and your name. this is the code:

  <div class="type_wine">
      <div class="check_type">@Html.CheckBox(color, check, new { @class = "wine" })</div>                                            
      <div id="type_text" onclick="checkByName('@color')">  color  </div>
  </div>

I must to do the same then I clicked the text and then I click on check box, then I do a click in the checkbox all is ok, but I have a problem then I clicked the text, because the checkbox state is not changed can sameone help me?

1 Answer 1

1

You could try something like

<div class="type_wine">
    <label>
        <div class="check_type">@Html.CheckBox(color, check, new { @class = "wine" }</div>
        <div id="type_text">
            color
        </div>
    </label>
</div>
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, but will be a problem if I have a list of checkboxes

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.