
Hello all, can I handle a form with more than one button in Yesod? In this case pair (button_name, button_value) is sent to the server on submit. Can I get it in some way? Best regards, Dmitry

On Thu, Nov 25, 2010 at 11:43 AM, Dmitry Olshansky
Hello all,
can I handle a form with more than one button in Yesod?
In this case pair (button_name, button_value) is sent to the server on submit. Can I get it in some way?
You can use the maybeStringInput function together with runFormPost' (notice the apostrophe) to get access to submissions without using the standard form setup. Depending on what you need, that may be sufficient. Michael

Well, I did it. But there are some loses...
Before I use GET method to submit and all fields were checked perfectly. Now
I use POST and they are didn't checked before post. After that now I have
two independent type conversions - automatically in Get and handly in
Post... From these points GET method looks more attractive.
Maybe it is possible to add *Maybe submit_button_name* into the result of
runFormGet?
Dima
2010/11/25 Michael Snoyman
On Thu, Nov 25, 2010 at 11:43 AM, Dmitry Olshansky
wrote: Hello all,
can I handle a form with more than one button in Yesod?
In this case pair (button_name, button_value) is sent to the server on submit. Can I get it in some way?
You can use the maybeStringInput function together with runFormPost' (notice the apostrophe) to get access to submissions without using the standard form setup. Depending on what you need, that may be sufficient.
Michael

I'm not quite sure what you mean by this. Can you please clarify?
On Thu, Nov 25, 2010 at 5:23 PM, Dmitry Olshansky
Well, I did it. But there are some loses...
Before I use GET method to submit and all fields were checked perfectly. Now I use POST and they are didn't checked before post. After that now I have two independent type conversions - automatically in Get and handly in Post... From these points GET method looks more attractive.
Maybe it is possible to add Maybe submit_button_name into the result of runFormGet? Dima 2010/11/25 Michael Snoyman
On Thu, Nov 25, 2010 at 11:43 AM, Dmitry Olshansky
wrote: Hello all,
can I handle a form with more than one button in Yesod?
In this case pair (button_name, button_value) is sent to the server on submit. Can I get it in some way?
You can use the maybeStringInput function together with runFormPost' (notice the apostrophe) to get access to submissions without using the standard form setup. Depending on what you need, that may be sufficient.
Michael
participants (2)
-
Dmitry Olshansky
-
Michael Snoyman