Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add htmlFor parameter to label element #203

Open
JohannesOehm opened this issue Dec 27, 2022 · 2 comments
Open

Add htmlFor parameter to label element #203

JohannesOehm opened this issue Dec 27, 2022 · 2 comments

Comments

@JohannesOehm
Copy link

JohannesOehm commented Dec 27, 2022

Currently, you have to do:

checkBoxInput(classes = "form-check-input", name = "myName") {
    id = "myId"
    value = "myValue"
}

label(classes="myclass") {
  htmlFor="myId"
  +"Check me" 
}

However, a label without for attribute is not very common. It should be a parameter, so that it is much more concise to write:

label(classes = "myclass",  htmlFor = "myId") {
  +"Check me" 
}
@martinstender
Copy link

martinstender commented May 23, 2023

Can't you just go:
label (classes = "") { attributes["for"] = "myId" +"Check me" }
?

@JohannesOehm
Copy link
Author

thats my first solution, but written without linebreak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants