I have a very simple login form with username / password. Is there a way to POST this form to the server and check for a 200s response without having to go through the coding gymnastics required to track the value of each field character by character as the user types? (Yes, I understand that it is the Elm way to do things, but adding two fields to my model, two Msg with accompanying entries in update just seems like a lot of unneeded code for a simple login form, and storing the password in the model forever seems like a bad idea.)
I have read these two questions, and I have found the onSubmit event. However, I am not sure what to do once update receives the message that the onSubmit event has fired. I feel like there might be two ways forward and I can't figure out how to do either:
- Create a POST request directly from the form and send it to the server
- Grab the values of the two fields and package them up myself to send to the server.
I would use the default submit function, but I would prefer to login with an asynchronous request and not leave the page.