I'm still not exactly sure what you're trying to do, but if you should
be able to add fields to the form object you cloned pretty easily with
appendChild.


Dagur Páll Ammendrup wrote:
> [EMAIL PROTECTED] wrote:
> > But here's a question... why are you trying to put this object into a
> > string? Seems like you'd be better off just keeping it an object.
> > Perhaps you'd be better off with a simple
> > test = document.getElementById('id_embeddedvideo.0.type'); or, if you
> > needed to do something with it, maybe something like
> > test.cloneNode(true)
> >
> > Just a thought. It seems to me that at BEST, trying to put it into a
> > string is going to be fragile.
> >
> >
> >
> The idea is to spit out more fields dynamically (I just increment the
> .0. part each time). It worked great for other stuff. Example:
>
>     var next_file_no = 1;
>
>     function getFileField(){
>         var orig = '<p><label>Description</label>{{
> form.fileattachment.0.description }}<label>File</label>{{
> form.fileattachment.0.image }}{{ form.fileattachment.0.image_file }}</p>';
>         var filefields = document.getElementById('filefields');
>         orig = orig.replace(/\.0\./g,'.' + next_file_no + '.');
>         next_file_no += 1;
>         filefields.innerHTML += orig;
>     }
>
> Your idea is a little more work but I think I'll attempt that rather
> than creating a filter.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to