I am currently developing Haskell on the Yesod web platform, and I need to create a form on one of my web pages. This form should contain several flags, but they need to be grouped into categories. For example, the user needs to select 3 disciplines in a list of 10 flags, 5 items and of which a maximum of 2 can be weapons.
I read parts of the book on the Yesod website, and from my understanding I need to create a custom field to create grouped checkboxes. Unfortunately, I am not very good at Haskell (I just started using it 1-2 weeks ago), and I have some difficulties understanding how I could achieve this. For reference, this is the page I read about a book on the Yesod website that talks about custom fields: http://www.yesodweb.com/book/forms
Knowing that my question will be: how to create grouped checkboxes in Haskell / Yesod?
EDIT: In the link I provided, I understand the last two values ββof the field constructor (fieldView and fieldEnctype), this is the first (fieldParse) that I don't know how to change for my purpose. Here is an example of the link that I referenced:
passwordConfirmField :: Field Handler Text passwordConfirmField = Field { fieldParse = \rawVals _fileVals -> case rawVals of [a, b] | a == b -> return $ Right $ Just a | otherwise -> return $ Left "Passwords don't match" [] -> return $ Right Nothing _ -> return $ Left "You must enter two values" , fieldView = \idAttr nameAttr otherAttrs eResult isReq -> [whamlet| <input id=
source share