Generic-user-small tranchula 3 posts

hi, I’ve been reading the DOM chapter, but the examples that i download it want work…
Can’t I build the DOM dynamically from scratch, meaning i don’t want to write a single static line
and that goes for the drag and drop part… and if I can make the process work directly from JS
without the need to create a div container from within HTML tags but directly from JS in other words totally avoiding static code

 
Headshot_120px_small Christophe P... 48 posts

Hey,

So sorry, but I have no idea what you’re talking about… Could you perhaps illustrate your need?

 
Generic-user-small tranchula 3 posts

hey,
sorry for that,

1-> the dom examples from zipped code wont work but the direct link from the book does….... how to solve this??

2-> the dom code is a bit static, i need to make my code completely dynamic.. coz i’m working on an application where the user will be able to create his own form, using drag and drop…. and the example code presented is a bit static….

hope the questions are clear and u could help me out
10x in advance…

 
Headshot_120px_small Christophe P... 48 posts

Oh.

The archive wasn’t regenerated after the recent typo fix in one of the early code blocks. This only borked IE, are you using IE? This is all due to a superfluous comma before closing the nodes array. It’s been discussed in this thread already. I’ll ping PragProg to update the compressed archives.

You’ll have to explain “static”. Do you mean it is bound to elements already present in the DOM at load time? Going dynamic simply means that after injecting your form elements in the page’s DOM, you can register event handlers for them using observe calls, instead of doing so by name and at early DOM loading time. That’s pretty much all there is to it.

Also, it’s been my experience that in dynamic, user-controled forms, most of the event-related behavior is not field-specific, but by field kind. So perhaps using appropriate field classes and event delegation at the whole form’s level would be a win, too.

 
Generic-user-small tranchula 3 posts

hey,
10x for the reply….

I meant by static, that I don’t want to use HTML tags to create element but using JavaScriptcreate element Dom functions or using the builder class provide it in the book.
btw I’m new to this user-controlled forms and I’m finding a hard time implementing it with JavaScript
If u could guide to a tutorial using prototype and scriptaculous that can help me with my quest, would be great…..

10x again…

5 posts, 2 voices