How do I add an id field to #textbox that also renders in HTML? (Plus other questions)

How do i add an actual id field to a #textbox? So far I have the following code:

%% -*- mode: nitrogen -*-




main() -> #template{file = "./site/templates/bare.html"}.

title() -> "Ookma-Kyi - Signup".

body() ->


        body = [

            #grid_8{alpha = true, prefix = 2, suffix = 2, omega = true, body = inner_body()}



inner_body() ->


        #h1{text = "Signup"},




        "        Please fill out the application below to register for an account.


        "        ",

        #label{for = username, text = "Username"},

        #textbox{id = username},

        #label{for = email, text = "Email"},

        #textbox{id = email},

        #label{for = password, text = "Password"},

        #password{id = password},

        #label{for = passwordconfirm, text = "Confirm Password"},

        #password{id = confirmpassword},


        #button{text = "Signup"}


However it is rendering this html:

<label class="wfid_temp1027 nitrogen_label" for="username" >Username</label>
<input type="text" autocomplete="off" class="wfid_username wfid_temp1059 textbox" value="" />
<label class="wfid_temp1091 nitrogen_label" for="email" >Email</label>
<input type="text" autocomplete="off" class="wfid_email wfid_temp1123 textbox" value="" />

Note there is no id parameter in the textfields itself.

Also I tried:

#textbox{id = username, aria-describeby=usernameHelpBlock }

and it produced an error.


Never used Nitrogen, but according to nitrogren-core/include/wf.hrl I think that you should use html_id for that purpose, not id.


Thanks, just took a quick peek because I was afraid of messing it up and noted that a search of aria produced no results. Does this mean nitrogen doesn’t support the aria-describedby tag?

Citation: aria-describedby - Accessibility | MDN

EDIT: Dumb question, Why was my quote removed?


Correct. Aria fields will be added in Nitrogen 3.

I don’t know what happened to a quote of yours


If you click on the pencil icon in the top right of your post it will give you a diff of edits with a reason at the top:


1 Like