Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jade doesn't render checkboxes text?

Tags:

html

checkbox

pug

im trying to put chekcboxes input on my html file using compiled jade, it renders the actual checkboxes but not the text i.e.

          p.confirm
            input(type="checkbox", name="agree") 
              | I agree to the Terms & Conditions of this Company <br />
            input(type="checkbox", name="subscribe") 
              | Tick to recieve future communication from Company

I tried the jade docs but nothing happens, thanks

like image 231
user1551482 Avatar asked Aug 05 '12 15:08

user1551482


2 Answers

I'm not sure how the accepted answer can work, as Jade will interpret the text as tags if not escaped.

Both of these will work instead:

p.confirm
  label
    input(type="checkbox", name="agree")
    | I agree to the Terms & Conditions of this Company
  br
  label
    input(type="checkbox", name="subscribe")
    = " Tick to recieve future communication from Company"

label is needed to make text clickable.

like image 142
gl03 Avatar answered Sep 29 '22 18:09

gl03


Input tags do not have children.

p.confirm
    input(type="checkbox", name="agree")
    I agree to the Terms & Conditions of this Company
    br
    input(type="checkbox", name="subscribe")
    Tick to recieve future communication from Company
like image 29
Amberlamps Avatar answered Sep 29 '22 18:09

Amberlamps