Best practise on using Django forms in jQuery UI modal dialogue.

250 views
Skip to first unread message

Chris Dew

unread,
Apr 25, 2009, 1:39:35 AM4/25/09
to Django users
I'd like to use something like the jQuery UI modal dialogues
http://jqueryui.com/demos/dialog/#modal in a web application.

My quandary is how to integrate this with Django.

The 'base page' has multiple links, each of which will open up a
different form in a modal dialogue. If the form in the dialogue
validates, the dialogue should close. If it fails to validate, then
it should be redisplayed, with Django's normal validation messages.

It seems inelegant to create one page with dozens of forms, on the off-
chance that the user may use one of them.

I'm therefore hoping that someone knows of an existing ajax modal
dialogue, which can simply be given a URL, and basically have the same
operational properties as a frame. I've spent several hours trying
boxy, but jQueryUI's date picker refuses to work with this.
http://onehackoranother.com/projects/jquery/boxy/

Do I just have to knuckle down and write custom javascript for this,
or is it a already a solved problem?

Thanks,

Chris.

cschams

unread,
Apr 25, 2009, 10:14:59 AM4/25/09
to Django users
You could try Thickbox, which has a modal mode, and supports iframed
and ajax content. Its almost a drop-in replacement for links to modal
dialogues and it degrades to simple links.
http://jquery.com/demo/thickbox/

On Apr 25, 12:39 am, Chris Dew <cms...@googlemail.com> wrote:
> I'd like to use something like the jQuery UI modal dialogueshttp://jqueryui.com/demos/dialog/#modalin a web application.
>
> My quandary is how to integrate this with Django.
>
> The 'base page' has multiple links, each of which will open up a
> different form in a modal dialogue.  If the form in the dialogue
> validates, the dialogue should close.  If it fails to validate, then
> it should be redisplayed, with Django's normal validation messages.
>
> It seems inelegant to create one page with dozens of forms, on the off-
> chance that the user may use one of them.
>
> I'm therefore hoping that someone knows of an existing ajax modal
> dialogue, which can simply be given a URL, and basically have the same
> operational properties as a frame.  I've spent several hours trying
> boxy, but jQueryUI's date picker refuses to work with this.http://onehackoranother.com/projects/jquery/boxy/

Chris Dew

unread,
Apr 25, 2009, 11:24:42 AM4/25/09
to Django users
Thanks, I'll give it a try.

On 25 Apr, 15:14, cschams <csch...@wkbt.com> wrote:
> You could try Thickbox, which has a modal mode, and supports iframed
> and ajax content. Its almost a drop-in replacement for links to modal
> dialogues and it degrades to simple links.http://jquery.com/demo/thickbox/
>
> On Apr 25, 12:39 am, Chris Dew <cms...@googlemail.com> wrote:
>
> > I'd like to use something like the jQuery UI modal dialogueshttp://jqueryui.com/demos/dialog/#modalina web application.
Reply all
Reply to author
Forward
0 new messages