Question

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?

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top