DVA
DVA

Reputation: 151

Checkbox values invisible

In my html, I am displaying checkboxes. My problem is, the values are set (as seen in Chrome debugger) but it's not visible to the browser. I have tried Firefox and Chrome to no avail. I also unlinked the CSS, but still the problem exists.

Here is the screenshot:

enter image description here

What am I doing wrong?

Upvotes: 2

Views: 286

Answers (2)

Mischa
Mischa

Reputation: 43298

Check boxes don't work like that, you just have to put the value next to it, using a <label> or something:

<input type="checkbox" id="1" name="criterias[]" value="Beauty"> <label for="1">Beauty</label>

Upvotes: 2

Magesh Kumaar
Magesh Kumaar

Reputation: 1467

You have the attribute value for a different reason !!

Value is used to assign a value to the element !

You have to mention the text to be displayed like below !

<input type="checkbox" name="vehicle" value="Bike">I love bikes
<input type="checkbox" name="vehicle" value="Car">I hate cars

Upvotes: 2

Related Questions