I am using jquery ui dialog
to display form. Unfortunately, this function clears hidden input with csrf token
inside my form. Can I somehow force dialog not to clear this field or do I have to store this token somewhere and set the proper field myself?
views:
29answers:
1
A:
Non-ideal situation, but why don't you disable CSRF protection for the view in question? Or do you have loads of forms in this kind of dialog?
Alternatively, why not have some JS that scrapes the token, parks it elsewhere in the DOM and then you override the problematic function to clone the token input back to its original place once all other activity is done?
stevejalim
2010-08-23 19:38:34
The first option is no good for me. I thought about the second, but I didn't like it too much. It seems as the only solution though. Thanks.
gruszczy
2010-08-23 19:53:19
Agreed, it ain't pretty, but if it works, then that's good.
stevejalim
2010-08-23 20:29:15