Dart CheckboxInputElement doesn't show text -
dart checkboxinputelement adds specified text between opening , ending input tags , browser ignores text. example, following dart code:
formelement form = new formelement(); checkboxinputelement option = new checkboxinputelement(); option.name = "text1"; option.value = "text1"; option.text = "text1"; form.children.add(option); window.children.add(form);
creates following html code:
<form> <input type="checkbox" name="text1" value"text1">text1</input> </form>
i end checkboxes without descriptors.
you have add label descriptor text , link checkbox:
formelement form = new formelement(); checkboxinputelement option = new checkboxinputelement(); option.name = "text1"; option.value = "text1"; option.id = "text1"; form.children.add(option); labelelement label = new labelelement(); label.htmlfor = 'text1'; label.text = "this checkbox label"; form.children.add(label); window.children.add(form);
the property input id specified , connect them (so clicking on label text toggle checkbox) .
you end following html:
<form> <input type="checkbox" name="text1" value="text1" id="text1"> <label for="text1">this checkbox label</label> </form>
Comments
Post a Comment