Hi, I have a form created using kotlin html dsl. Inside the form there’s a combo box that is populated using dataList. When a user click one of the combo box value. I want to fetch the data from the server and populate the price field.
the html dsl have onClick and onChange attributes, but it only receive string parameter. While kotlin js have onClickFunction that accept lambda as argument. But I’m still a bit confused how to mix the dsl with kotlin js. Since this is not a kotlin js project. Any guidance?
Thanks
form("/order/product/${order.id}/add", method = FormMethod.post, classes = "form-signin") {
input(InputType.text, name = "product", classes = "form-control") {
list = "productList"
required = true
placeholder = "product"
dataList {
id = "productList"
products.forEach {
option {
value = it.name
}
}
}
}
input(InputType.text, name = "price", classes = "form-control") {
required = true
placeholder = "price"
}
input(InputType.submit, classes = "btn btn-lg btn-primary btn-block") { value = "Save" }
}