How to use Zend Framework Form Hash (token) with AJAX

前端 未结 6 744

I have included Zend_Form_Element_Hash into a form multiplecheckbox form. I have jQuery set to fire off an AJAX request when a checkbox is clicked, I pass the token with thi

6条回答
  •  死守一世寂寞
    2020-12-28 09:22

    Form hashes are great in principle and a bit of a nightmare in practice. I think the best way to handle this is to return the new hash with the response when you make a request, and update the form markup or store in memory for your javascript as appropriate.

    The new hash may be available from the form object, or you can read it from the session.

提交回复
热议问题