Did you have to do anything special to get the AJAX request to pass the 
CSRF check?

On Monday, March 11, 2013 1:33:58 PM UTC-4, Дмитрий Белавенцев wrote:
>
> Thanks a lot, Josh! It helps me! =)
>
> Maybe it will help someone: my js code for ajax form submitting (
> https://gist.github.com/dizpers/5135981) and my html (
> https://gist.github.com/dizpers/5135994).
>
> понедельник, 11 марта 2013 г., 5:05:14 UTC+7 пользователь Josh Cartmell 
> написал:
>>
>> Since Bootstrap modals can load another page via ajax you might be able 
>> to just have the entire contact page be loaded into the modal and use css 
>> to hide everything except the form.  Something that I've done before to 
>> have a form show on multiple pages (not in a modal, but it's a similar 
>> idea) is create a custom template tag to place a page's form into the 
>> context passing in the page's slug.  I then create a custom page_processor 
>> that handles ajax form submissions.
>>
>> I just put the template tag and page processor into a gist which you can 
>> see here:
>> https://gist.github.com/joshcartme/5130702
>>
>> After calling the template tag you will have the form in your template 
>> context and you can render it however you like.  From there use a little 
>> bit of jquery, or whatever javascript you like to handle submitting the 
>> form and handling any response.
>>
>> On Sun, Mar 10, 2013 at 7:19 AM, Дмитрий Белавенцев <[email protected]>wrote:
>>
>>> I need standart "Contact us" form (name, email, message). It should 
>>> appear inside modal by clicking link in menu. Should I create form Page in 
>>> mezzanine and somehow insert it into modal, if so - how can I do it? Or the 
>>> better way is to add form manually  in template? 
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Mezzanine Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to