How to get user input in Yesod without using Yesod Form

164 Views Asked by At

In my page I have a search field(text area).

Yesod Form is quite complicated to use, so I figure I'll just use Javascript to get the value typed by the user. But then how my Haskell program gets that value?

1

There are 1 best solutions below

1
arrowd On BEST ANSWER

You need to make a HTTP request to the server and pass it data.

In case of GET request, you just declare handler parameters in config/routes and then get them as getYourHandlerR arguments. In case of POST, you can use requireJsonBody to get data as JSON or getPostParams.