Getting value out of a Halogen.HTML.select components onChange event

I have a basic Halogen.HTML.select element with some options defined and choosing a new option triggers an Halogen.HTML.Events.onChange Event. I am able to extract a EventTarget from the Event but I am struggling to find a way to access the string value of that EventTarget.

I am still very new to purescript and halogen but have already gone through halogen docs, basic purescript tutorials and explored docs on pursuit.

if you only need the value I’d recommend using onValueChange instead of onChange (if you need the target too, consider using some keys/indizes identifiable from your model and pass this via partial application to onValueChange when you render your model: myHandler :: MyIndex -> String -> .. and onValueChange (myHandler theIndex))

Thank you :+1: I had tried onValueChange before and got some error so I thought it wasn’t supported by the element. Must have made some silly mistake earlier

1 Like