Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
rob :: digitalburn #1
adding elements to the DOM
Hi all,
I'm pretty sure this can be done, but I'm not sure. I'm trying to figure out
how an element can be added to the document on the fly (due to user input),
using JavaScript. For example, adding an addition input field to a form if
the user wants one (I'm familiar with setting up the field once it's
actually there).
If anyone's curious, it's for a CMS system. Any help would be very much
appreciated.
Thanks
Rob
rob :: digitalburn Guest
-
DW9 quits when adding Spry Menu elements
Using version 9.0 build 3481 on a Mac G5 tower (2@ 2GHz). I inserted a Spry Menu Bar (vertical). Adding the first few items went smoothly, but now... -
Adding layout elements within custom control
Hi all, I have a custom control that I use within forms that contains form inputs and validator controls. At the moment I'm overriding the Render... -
Adding Spread Sheet or Tables to Elements?
I am trying to figure out how to add a spread sheet or columned text to an element document formatted as a brochure -
Adding elements/properties to class
Ok I have written a simple little class (Attached below.) Is there a way to add elements to this class in my main movie file? like instead of test... -
Adding a Copyright Layer in Elements 2.0
I would like to go ahead and pre-save copyright labels such as "Photos by Ken Little © 2003" on different transparent layers in different colors with... -
rob :: digitalburn #2
Re: adding elements to the DOM
Hum, I found an IE specific way to do it easily (insertAdjacentHTML), but
I'd rather find a DOM compatible technique.
I did find the DOM way to create an element (createElement), but no way to
insert it into the document tree.
rob :: digitalburn Guest
-
danilocelic #3
Re: adding elements to the DOM
rob :: digitalburn wrote:
you could try to append to the innerHTML of the form tag.> Hi all,
>
> I'm pretty sure this can be done, but I'm not sure. I'm trying to figure out
> how an element can be added to the document on the fly (due to user input),
> using JavaScript. For example, adding an addition input field to a form if
> the user wants one (I'm familiar with setting up the field once it's
> actually there).
>
> If anyone's curious, it's for a CMS system. Any help would be very much
> appreciated.
place in the head of your document:
<script>
function addFormField(f){
f.innerHTML += '<input type="text" name="newTextField" value="type here">';
}
</script>
then put this button on your page:
<input type="button" value="Add Field" onclick="addFormField(this.form)">
this will add to the end of your form. Of course you may not want it at
the end, but in a particular place, if so, then you could add a div
inside your form and append to it's innerHTML.
--
Enjoy,
Danilo Celic
| Extending Knowledge, Daily
| [url]http://www.CommunityMX.com/[/url]
Those who aren't looking often have their eyes open widest.
danilocelic Guest
-
rob :: digitalburn #4
Re: adding elements to the DOM
Thanks. If I was going to do this, I might as well use the system I outlined
above though, as it's more robust I think. What I'm really looking for is
something DOM compatible - as far as I know, the innerHTML property is IE
only.
Thanks again.
"danilocelic" <danilo@shimmerphase.com> wrote in message
news:bn8s44$kd2$1@forums.macromedia.com...out> rob :: digitalburn wrote:
>> > Hi all,
> >
> > I'm pretty sure this can be done, but I'm not sure. I'm trying to figureinput),> > how an element can be added to the document on the fly (due to userif> > using JavaScript. For example, adding an addition input field to a formhere">';>> > the user wants one (I'm familiar with setting up the field once it's
> > actually there).
> >
> > If anyone's curious, it's for a CMS system. Any help would be very much
> > appreciated.
> you could try to append to the innerHTML of the form tag.
>
> place in the head of your document:
>
> <script>
> function addFormField(f){
> f.innerHTML += '<input type="text" name="newTextField" value="type> }
> </script>
>
> then put this button on your page:
>
> <input type="button" value="Add Field" onclick="addFormField(this.form)">
>
>
> this will add to the end of your form. Of course you may not want it at
> the end, but in a particular place, if so, then you could add a div
> inside your form and append to it's innerHTML.
>
>
> --
> Enjoy,
> Danilo Celic
>
> | Extending Knowledge, Daily
> | [url]http://www.CommunityMX.com/[/url]
>
> Those who aren't looking often have their eyes open widest.
>
rob :: digitalburn Guest
-
danilocelic #5
Re: adding elements to the DOM
rob :: digitalburn wrote:
The method I showed works in NN7.1 and IE6. Didn't test in other browsers.> Thanks. If I was going to do this, I might as well use the system I outlined
> above though, as it's more robust I think. What I'm really looking for is
> something DOM compatible - as far as I know, the innerHTML property is IE
> only.
--
Enjoy,
Danilo Celic
| Extending Knowledge, Daily
| [url]http://www.CommunityMX.com/[/url]
Those who aren't looking often have their eyes open widest.
danilocelic Guest
-
rob :: digitalburn #6
Re: adding elements to the DOM
I'm not too fussed about browser compatibility (as only one person will use
this and he has IE), I've just suddenly got a thing for W3C standards, and
according to the reference that comes with DW, innerHTML ain't in them :) It
doesn't really matter though, thanks for your time :)
> The method I showed works in NN7.1 and IE6. Didn't test in other browsers.
>
> --
> Enjoy,
> Danilo Celic
>
> | Extending Knowledge, Daily
> | [url]http://www.CommunityMX.com/[/url]
>
> Those who aren't looking often have their eyes open widest.
>
rob :: digitalburn Guest
-
danilocelic #7
Re: adding elements to the DOM
rob :: digitalburn wrote:
You're correct, it's not part of the spec, but modern browsers support> I'm not too fussed about browser compatibility (as only one person will use
> this and he has IE), I've just suddenly got a thing for W3C standards, and
> according to the reference that comes with DW, innerHTML ain't in them :) It
> doesn't really matter though, thanks for your time :)
it, and that's enough for me.
Enjoy,
Danilo Celic
| Extending Knowledge, Daily
| [url]http://www.CommunityMX.com/[/url]
Those who aren't looking often have their eyes open widest.
danilocelic Guest
-
rob :: digitalburn #8
Re: adding elements to the DOM
I must admit I usually use it too... I was just set on doing things the
'proper' way this time around :)
rob :: digitalburn Guest



Reply With Quote

